Game code framework generation method and device, storage medium and electronic equipment
By extracting and integrating game video content features of multiple modalities, and using big models to generate game code frameworks, the problem of inefficient game development in the existing technology is solved, and an automated generation of innovative code frameworks is realized.
Patent Information
- Application Number
- CN202411615734.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-02-28
AI Technical Summary
In the prior art, game developers need to manually write different game code frameworks, resulting in inefficient game development and inability to effectively utilize the game logic differences of different games.
By obtaining game videos of at least two games, extracting content data of multiple modalities (image, text, audio), determining content features, fusion features, and inputting a large model to generate a code framework for the game to be developed.
It realizes automatic generation of game code frameworks, improves game development efficiency, reduces the steps for developers to manually write code frameworks, and can generate innovative code frameworks based on different game videos.
Smart Images

Figure CN119536698A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, storage medium and electronic device for generating a game code framework. Background Art
[0002] In game development, developers usually need to write a game code framework, which provides definitions of the main classes and methods required to implement game functions. This can make the code structure clearer, improve the efficiency of the subsequent complete code writing process, and facilitate later maintenance.
[0003] Different games often have differences in gameplay rules, character behavior, level design, etc. Therefore, different games have different game logics, and different code frameworks need to be written for different games. Since the current game code framework relies on manual writing, the efficiency of game development is limited.
[0004] Therefore, this specification provides a method for generating a game code framework. Summary of the invention
[0005] This specification provides a game code framework generation method, device, storage medium and electronic device to at least partially solve the above-mentioned problems existing in the prior art.
[0006] This manual adopts the following technical solutions:
[0007] This specification provides a method for generating a game code framework, including:
[0008] Get gameplay videos of at least two games;
[0009] For each game video, determine content data of multiple modes of the game video according to the game video;
[0010] Determine the content features of each mode of the game video according to the content data of each mode;
[0011] Fusion the content features of each modality to determine the fusion features of the game video;
[0012] The fusion features of each game video are input into the big model, so that the big model determines each candidate game element, and determines the target game elements constituting the game to be developed from the candidate game elements, and generates the code framework of the game to be developed based on the target game elements.
[0013] Optionally, the content data of the multiple modalities include content data of image modality;
[0014] According to the game video, content data of multiple modes of the game video is determined, specifically including:
[0015] Inputting each video frame included in the game video into a recognition model to recognize a specific target in each video frame;
[0016] Determining each target image according to the identified video frame containing the specific target;
[0017] The target images are used as content data of the image mode of the game video.
[0018] Optionally, the content data of the multiple modalities include content data of a text modality;
[0019] According to the game video, content data of multiple modes of the game video is determined, specifically including:
[0020] Determine the target text according to the subtitles contained in the game video;
[0021] The target text is used as content data of the text mode of the game video.
[0022] Optionally, the content data of the multiple modalities include content data of an audio modality;
[0023] According to the game video, content data of multiple modes of the game video is determined, specifically including:
[0024] Extract the audio data from the game video;
[0025] The audio data is converted into text to obtain the converted text of the audio data as the content data of the audio mode of the game video.
[0026] Optionally, the content data of the multiple modalities include content data of image modality;
[0027] According to the content data of each mode, the content features of each mode of the game video are determined, including:
[0028] Determine each target image included in the content data of the image modality, and determine image features of each target image;
[0029] Clustering the target images according to the features of the images;
[0030] According to the clustering results, the content characteristics of the game video image modality are determined.
[0031] Optionally, the content data of the multiple modalities include content data of a text modality;
[0032] According to the content data of each mode, the content features of each mode of the game video are determined, including:
[0033] According to a preset segmentation condition, the content data of the text modality is segmented into a plurality of text segments;
[0034] Input each text segment into a topic model to obtain a topic classification result of each text segment by the topic model;
[0035] According to the topic classification result, the content characteristics of the game video text mode are determined.
[0036] Optionally, generating a code framework of the game to be developed according to the target game element specifically includes:
[0037] Generating an alternative framework of the game to be developed according to the target game elements;
[0038] Predicting the duplication rate between games developed by the alternative framework and existing games;
[0039] When the repetition rate is less than a preset value, the candidate framework is used as the code framework of the game to be developed.
[0040] This specification provides a game code framework generation device, the device comprising:
[0041] An acquisition module is used to acquire game videos of at least two games;
[0042] A content data determination module, for each game video, determines content data of multiple modes of the game video according to the game video;
[0043] A content feature determination module, which determines the content features of each mode of the game video according to the content data of each mode;
[0044] A fusion module, which fuses the content features of each modality to determine the fusion features of the game video;
[0045] The generation module inputs the fusion features of each game video into the big model, so that the big model determines each candidate game element, and determines the target game elements constituting the game to be developed from the candidate game elements, and generates the code framework of the game to be developed based on the target game elements.
[0046] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned game code framework generation method is implemented.
[0047] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned game code framework generation method when executing the program.
[0048] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0049] In the method for generating a game code framework provided in this specification, game videos of at least two games are obtained. For each game video, content data of multiple modes of the game video is determined based on the game video, and content features of each mode of the game video are determined based on the content data of each mode. The content features of each mode of the game video are fused to determine the fusion features of the game video. The fusion features of each game video are input into a large model, so that the large model determines each candidate game element, and determines the target game element constituting the game to be developed from each candidate game element, and generates a code framework for the game to be developed based on the target game element.
[0050] This method uses the generation capability of a large model to infer the candidate game elements of at least two game videos based on the content data of multiple modes obtained from the game videos of at least two games, and then automatically generates the code framework of the game to be developed. In game development, developers only need to develop the code implementation details based on the code framework to obtain the complete game code, which saves the developer the step of manually writing the code framework and improves the efficiency of game development. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:
[0052] Figure 1 This is a flowchart of a method for generating a game code framework in this specification;
[0053] Figure 2 This is an example diagram of a racing game code framework provided in an embodiment of this specification;
[0054] Figure 3 An example of a logical structure diagram provided in an embodiment of this specification;
[0055] Figure 4 A schematic diagram of a game code framework generating device provided in this specification;
[0056] Figure 5 The corresponding Figure 1 Schematic diagram of electronic equipment. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0058] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0059] Figure 1 This is a flowchart of a method for generating a game code framework in this specification, which specifically includes the following steps:
[0060] S100: Obtain game videos of at least two games.
[0061] All steps in the game code framework generation method provided in this specification can be implemented by any electronic device with computing functions, such as a terminal, a server, etc. For the sake of ease of description, the game code framework generation method provided in this specification is described below with the server as the execution subject.
[0062] Based on the natural language understanding ability of the large model, there is currently a method for generating program code based on the natural language description input by the user. In this method, the user is required to explain the implementation functions of the program code to be generated in the form of natural language. In game development, a complete game code usually involves multiple functional modules such as game logic, game mechanism, system interaction, game balance, etc. When using the existing code automatic generation method for game development, professionals are still required to convert the functions that need to be implemented in the game to be developed into detailed natural language descriptions, and the workload is still very large.
[0063] By applying the game code framework generation method in this manual, the user only needs to input the game video to obtain a code framework containing various functional modules of the game to be developed, which can significantly improve the game development efficiency.
[0064] The game videos used to generate the code framework in this specification are game videos from at least two games, and the game implementation logics shown in the at least two game videos are used to guide the generation of the code framework of the game to be developed. That is, the code framework of the game to be developed obtained by applying this method is related to the video content of the input game video.
[0065] The game video in this specification can be a game trailer of the game to be developed, or an original screen recording video of an existing game of the same type as the game to be developed, or a composite video edited and processed based on the original screen recording video, etc. As long as the game video can reflect any game content such as the game background, game characters, game plot, game mechanism, game play, etc., this specification does not make any specific restrictions on the source of the game video.
[0066] This specification does not limit the specific number of game videos, but in order to ensure that the server can generate an innovative code framework through a large model, the number of game videos is at least two. The more game videos there are, the more diverse the video content data of each game video obtained by the server, and the greater the possibility of obtaining an innovative code framework in the end.
[0067] S102: For each game video, determine content data of multiple modes of the game video based on the game video.
[0068] In order to generate a code framework that matches the game video, after the server obtains each game video input by the user, it needs to parse the game video to obtain content data of multiple modes of each game video.
[0069] The multiple modal content data determined in this step may be composed of at least two modal content data of image modal content data, text modal content data, and audio modal content data. Because the game video does not necessarily contain audio or subtitles, in the implementation process of this step, the specific modal content data to be selected needs to be determined according to the actual situation of the game video obtained in step S100.
[0070] The content data of the image modality can be determined based on the video frame, and the specific determination method is as follows.
[0071] For each game video, the server determines each target image according to each video frame contained in the game video, and uses each target image as content data of the image mode of the game video.
[0072] There are many ways to determine the target image. For example, the server uses all video frames contained in the game video as target images. Alternatively, the server screens each video frame and determines each target image based on the screening results. The specific screening method can be manual screening or screening through a machine learning model.
[0073] The content data of the text mode can be determined based on the subtitles of the game video, and the specific determination method is as follows.
[0074] The server determines the target text for each game video according to the subtitles contained in the game video, and uses the target text as the content data of the text mode of the game video.
[0075] There are many ways to determine the target text. For example, the server uses all subtitles contained in the game video as the target text. Alternatively, because subtitles usually contain multiple types of content descriptions such as dialogues, sound effects, and scenes, the server can also determine the target text based on one or more types of content descriptions in the subtitles.
[0076] This specification does not limit the method of obtaining subtitles. The server can read the subtitle file corresponding to the game video, or extract the embedded subtitles in the game video through any existing subtitle extraction tool to obtain the subtitles in the game video.
[0077] The content data of the audio modality can be determined based on the audio data of the game video, and the specific determination method is as follows.
[0078] The server extracts the audio data in each game video, converts the audio data into text, obtains the converted text of the audio data, and uses the converted text as the content data of the audio mode of the game video. At this time, the content data of the audio mode is stored in the form of text.
[0079] Alternatively, the server may also directly use the audio data in the game video as the content data of the audio mode of the game video. At this time, the content data of the audio mode is stored in the form of an audio signal.
[0080] The video frames in the game video are used to show the visual images during the game. The content data of the image mode determined based on the video frames can be used for the big model to understand the visual elements of the game in the subsequent code generation stage. The audio in the game video is usually the real-time voice generated during the game, such as live commentary, player dialogue, etc. The content data of the audio mode determined based on the audio can be used for the big model to understand the real-time progress of the game in the subsequent code framework generation stage. The subtitles in the game video are usually the text content pre-set in the game design stage. The content data of the text mode determined based on the subtitles can be used for the big model to understand the game's own mechanism, such as the game plot and game tasks, in the subsequent code framework generation stage.
[0081] The content data of multiple modalities expresses the implementation logic of the game presented in the game video from the dimensions of multiple data modalities, so that the large model can infer the semantic information of each game video based on the content data of multiple modalities, and determine the target game elements that constitute the game to be developed for the generation of the code framework.
[0082] S104: Determine content features of each mode of the game video based on content data of each mode.
[0083] After the server determines the content data of each mode of the game video, it vectorizes the content data of each mode and determines the content features of each mode of the game video, so as to use the features of each video as the input of the big model and enable the big model to generate the code framework of the game to be developed.
[0084] When content data of multiple modalities includes content data of image modality, the server determines the content features of the game image modality.
[0085] Specifically, the server determines each target image included in the content data of the image modality, and then determines the image features of each target image, and determines the content data of the image modality according to each image feature.
[0086] In this embodiment, the image features can be determined by any existing image feature extraction method, such as machine learning models such as the Inception V3 model, the VGG model, and the ResNet model, visual features such as the Scale-Invariant Feature Transform (SIFT) and the Histogram of Oriented Gradients (HOG), and statistical methods such as color histograms and texture features.
[0087] In one embodiment, the server may take each image feature as content data of the image modality.
[0088] When the content data of the multiple modes include the content data of the text mode, the server determines the content characteristics of the game text mode.
[0089] In one embodiment, the server may determine text features of the target text of the game video, and use the text features as content features of the text modality of the game video.
[0090] The server can perform feature encoding on the target text through any text encoder, such as BERT, Transformer model, etc., to determine the text features of the target text.
[0091] When content data of multiple modalities include content data of an audio modality, the server determines content features of the game audio modality.
[0092] When the content data of the audio modality is stored in the form of text, the server can determine the text features of the converted text as the content features of the audio modality of the game video. The text features of the converted text can also be determined by any text encoder. When the content data of the audio modality is stored in the form of an audio signal, the server can use an audio feature recognition tool to encode the audio features of the audio signal as the content features of the audio modality of the game video.
[0093] S106: Fusing the content features of each modality to determine the fusion features of the game video.
[0094] In order to integrate the semantic information of content features of multiple modalities, the server fuses the content features of each modality of the game video to determine the fusion features of the game video.
[0095] This specification does not limit the specific method of fusion, and fusion can be performed by feature weighting, splicing, cross-attention calculation, etc.
[0096] S108: Input the fusion features of each game video into the big model, so that the big model determines each candidate game element, and determines the target game elements that constitute the game to be developed from the candidate game elements, and generates the code framework of the game to be developed based on the target game elements.
[0097] The fused features of a game video contain the semantics of multiple data modalities of the game video. After the fused features of a game video are input into the big model, the big model can understand the semantics of each data modality based on the fused features, and infer the game elements in the game video as alternative game elements.
[0098] The game elements here may include gameplay elements, character setting elements, character growth mechanism elements, scene elements, level design elements, task structure elements, plot development elements, control method elements, sound effect elements, art design elements, interaction mechanism elements, reward mechanism elements and the like. The specific game elements inferred are related to the video content of the game video obtained in step S100.
[0099] Take a tactical game video as an example, the video content of the game video is a game task of city wall defense. Based on the fusion features of the game video, the server can infer scene elements such as undulating terrain, destructible city walls, arrow tower defense points, gameplay elements such as weapon restraint system, terrain influence, unit synergy effect, and role setting elements such as melee units, ranged units, cavalry units, and flying units.
[0100] Different games differ in game mechanisms, scenes, character settings, and other aspects. Therefore, the model can infer multiple different game elements as candidate game elements based on the fusion features of game videos from different games.
[0101] Then, the big model determines the target game elements constituting the game to be developed from among the candidate elements, so as to generate a code framework of the game to be developed according to the target game elements.
[0102] The following will take a process of generating a code framework for a racing game as an example to illustrate the code framework generation method provided in this specification. In the developable scenario of this embodiment, step S100 obtains videos of two racing games.
[0103] Based on the first video, the large model infers the following alternative game elements based on the content features of the visual modality: the track type is a city street, the obstacles are traffic cones and roadblocks, and the weather is sunny. Based on the content features of the text modality, the inferred alternative game elements include: 5 laps in total, currently 3 / 5 of the race, the speed is 180km / h, and nitrogen acceleration is available. Based on the content features of the audio modality, the inferred alternative game elements include: engine sound and fast-paced electronic music.
[0104] Based on the second video, the large model infers the following alternative game elements based on the content features of the visual modality: the track type is a mountain road and the weather is heavy snow. Based on the content features of the text modality, the inferred alternative game elements include: 9 laps in total, currently 4 / 9 of the race, turning, speed is 200km / h, and brakes are available. Based on the content features of the audio modality, the inferred alternative game elements include: engine sound and fast-paced electronic music. Based on the second video, the large model infers the following alternative game elements based on the content features of the audio modality: tire friction sound and collision sound.
[0105] The big model can determine the composition of a target game element, the track type is a city street, the obstacles are traffic cones and roadblocks, the weather is heavy snow, nitrogen acceleration, braking, steering, physics engine, friction, and collision. The code framework generated by the big model can be as follows Figure 2 As shown, Figure 2 This is an example diagram of a racing game code framework provided in an embodiment of this specification.
[0106] like Figure 2 As shown, the large model generates code modules such as acceleration logic, steering logic, nitrogen acceleration logic, collision logic, friction logic, track generation logic, obstacle placement logic, and race end judgment. Currently, the specific implementations of these code modules are empty and need to be further implemented by developers.
[0107] from Figure 2 From the code module shown, it can be seen that because the target game elements determined by the big model are the result of integrating the candidate game elements of multiple games, the target game elements determined by the big model for constituting the game to be developed are different from the candidate elements of any video, and the code framework generated by the big model based on the target game elements is also different from the game logic shown in the first video and the second video. That is, the game framework generation method in this specification can develop innovative games.
[0108] It can be seen that through the code framework generation method provided in this specification, during the game development process, developers no longer need to manually write the code framework, and can focus on the implementation of specific code logic, thereby improving game development efficiency.
[0109] This method uses the generation capability of a large model to infer the various candidate game elements of the at least two game videos based on the content data of multiple modes obtained from the game videos of at least two games, and then automatically generates the code framework of the game to be developed. In game development, developers only need to develop the code implementation details based on the code framework to obtain the complete game code, eliminating the development steps of developers manually writing the code framework, and improving the efficiency of game development. Therefore, through the game code framework generation method in this specification, while improving the efficiency of game development, the innovation of the generated game framework can be guaranteed.
[0110] In the above step S102, the server may screen each video frame by machine learning to determine each target image.
[0111] Specifically, the server inputs each video frame of the game video into a trained recognition model to identify specific targets in each video frame.
[0112] The server can train the recognition model in advance by annotating sample images of specific targets, so that the trained recognition model can be used for recognition tasks of specific targets.
[0113] This specification does not limit the specific model structure of the recognition model, and any existing machine learning model that can be used for target recognition can be selected, such as the YOLO series model, the Fast Region-based Convolutional Network (Faster R-CNN) model, etc.
[0114] Then, the server determines each target image based on the identified video frames containing the specific target.
[0115] In one embodiment, the server may use each video frame containing a specific target as each target image. In another embodiment, the server extracts the image region corresponding to the specific target in each video frame containing the specific target, and obtains the image region extracted from each video frame containing the specific target as each target image. The specific specific target needs to be set according to development requirements.
[0116] This specification does not limit the number of specific targets. For example, if the game video is a video of a racing game, the specific targets are the racing car and the track. The server inputs each video frame contained in the game video into the recognition model to identify the racing car and the track in each video frame. Then, the server extracts the identified video frames containing the racing car and the track, or extracts the image areas of the racing car and the track in each video frame, and uses the extracted image areas as each target image.
[0117] In this embodiment, through the screening method, some video frames in the game video, or some image areas in some video frames, are used as target images. Then each target image contains part of the visual information of the video frame, which is suitable for game development scenarios with relatively simple game elements.
[0118] The target image determination method in step S102 uses all video frames of the game video as target images, and each target image contains all visual information of the video frame, which is suitable for the development of games with more game elements. The appropriate target image determination method can be selected according to different game development scenarios.
[0119] In the above step S102, in order to make the game content data better represent the game implementation logic displayed by the game video, in one or more embodiments of this specification, the server may also classify the subtitles according to different types of content descriptions, and determine the target text based on the classification results.
[0120] Specifically, the server can extract subtitle segments corresponding to different content descriptions in the subtitles according to preset extraction rules as classified texts of various content descriptions. The server can select one or more classified texts of content descriptions from the classified texts of various content descriptions as target texts. For example, the server only uses the classified texts corresponding to the dialogues of game characters as target texts. The specific extraction rules here can be determined according to development requirements and the presentation rules of subtitles.
[0121] In the presentation of game subtitles, different types of content are usually distinguished by adding different symbols. The server can locate different types of content descriptions in the subtitles by identifying the symbolic identifiers corresponding to different types of content descriptions, and obtain classified texts of different content descriptions.
[0122] In an example of a game subtitle presentation rule, the game character's identifier and the game character's dialogue are separated by ":", such as "Character A: We must act immediately". Sound effects are contained in "[]", such as "[explosion sound]". Scenes are contained in "()", such as "(background: busy street)". The server can identify the speaking game character and the game character's dialogue content by identifying the ":" in the subtitles, identify the sound effects by identifying the "[]", and identify the scene by identifying the "()".
[0123] The content data of the text modality determined based on the present embodiment has been divided according to the categories of content description. Therefore, when determining the content features of the text model based on the content data of the text modality of the present embodiment, it is only necessary to follow the method in the above-mentioned step S104 and directly perform feature encoding on the target text obtained in the present embodiment through any text encoder.
[0124] In one or more embodiments of the present specification, the content features of the image modality in the above step S104 can be determined by clustering.
[0125] First, the server determines each target image included in the content data of the image modality, and determines the image features of each target image according to any one of the image feature determination methods described in the above step S104.
[0126] Then, the server clusters each target image according to the image features of each target image, and determines the content features of the game video image modality according to the clustering results.
[0127] Specifically, after the server clusters each target image, a classification matrix is obtained. Each column of the classification matrix can represent each cluster obtained by clustering, and each row can represent each target image. The element a in the i-th row and j-th column of the classification matrix is ij It is used to indicate the matching probability between the target image represented by the i-th row and the cluster represented by the j-th column. In this embodiment, the meanings of the rows and columns of the category division matrix are interchangeable.
[0128] The server may use the category division matrix as the content feature of the game video image mode. Alternatively, the server may convert the category division matrix into a one-hot encoding form and use the category division matrix in the one-hot encoding form as the content feature of the game video image mode.
[0129] Among them, the method of converting the category partition matrix into a one-hot encoding form is as follows:
[0130] For each row of the category division matrix, the server determines the maximum matching probability among the matching probabilities in the row, and determines the cluster represented by the column corresponding to the maximum matching probability as the cluster to which the target image represented by the row belongs.
[0131] The target features are determined according to the clusters to which the target images represented by each row belong. The meanings of the rows and columns in the target matrix corresponding to the target features are the same as those of the category division matrix. For each row in the target matrix, the server sets the element in the column where the cluster to which the target image represented by the row belongs to as 1, and sets the other elements in the row as 0. The target matrix finally obtained is in the form of one-hot encoding, and the server can use the target matrix as the content feature of the game video image mode.
[0132] In one or more embodiments of the present specification, the content features of the text modality in the above step S104 can be determined by a topic analysis method.
[0133] First, the server determines the target text corresponding to the content feature of the text modality, and divides the target text into multiple text segments according to a preset segmentation condition. The segmentation condition here can be set according to a variety of standards.
[0134] For example, by time setting, the server can determine the time periods corresponding to the game video according to the preset segmentation time. The server determines the target text belonging to the time period as the text segment of the time period according to the timestamp of the subtitle corresponding to the target text.
[0135] For another example, according to the game scene setting, the subtitles contain content representing the scene, and the server can determine the time node of the scene change through the content description representing the scene in the subtitles and the timestamp of the subtitles, and divide the target text into time periods according to the determined time nodes, and determine the text segments of each time period.
[0136] Secondly, the server inputs each text segment into the topic model to obtain the topic classification result of each text segment by the topic model. According to the topic classification result, the content features of the game video text modality are determined.
[0137] The topic model in this embodiment can be any existing topic model, such as Latent Semantic Analysis (LSA), Latent Dirichlet Allocation (LDA), etc.
[0138] The server can obtain the document topic matrix corresponding to each text segment through the topic model. Each column of the document topic matrix can represent each topic determined by the topic model according to the semantics of each text segment, and each row can represent each text segment. The element a in the i-th row and j-th column of the document topic matrix ij It is used to indicate the matching probability between the text segment represented by the i-th row and the topic represented by the j-th column. In this embodiment, the meanings of the rows and columns of the document topic matrix are interchangeable.
[0139] The server may use the document topic matrix as the content feature of the game video text mode. Alternatively, the server converts the document topic matrix into a one-hot encoding form and uses the document topic matrix in the one-hot encoding form as the content feature of the game video text mode.
[0140] The method of converting the document topic matrix into a one-hot encoding form is similar to the above method of converting the category partition matrix into a one-hot encoding form, and will not be repeated here.
[0141] In one or more embodiments of the present specification, when in the above-mentioned step S104, the content data of each modality includes content data of image modality, content data of text modality and content data of audio modality, in order to obtain more accurate fusion features in step S106, the server may align the content data of different modalities in time according to timestamps.
[0142] Specifically, for each game video, the server determines the target images contained in the content data of the image modality of the game video, the target text corresponding to the content data of the text modality, and the conversion text corresponding to the content data of the audio modality.
[0143] Then, for each target image, the server determines a target text segment synchronized with the video frame time of the target image, and a converted text segment synchronized with the video frame time of the target image, based on the timestamp of the video frame of the target image, the timestamp of the subtitle corresponding to the target text, and the timestamp of the audio corresponding to the converted text. The target image, the target text segment synchronized with the video frame time of the target image, and the converted text segment synchronized with the video frame time of the target image are used as synchronization data of the target image.
[0144] When determining the content features of each modality, the server distributes and determines, for each target image, the image features of the target image, the text features of the target text segment synchronized with the video frame time of the target image, and the text features of the converted text segment synchronized with the video frame time of the target image in the synchronization data of the target image according to the vectorization method described in the above step S104 as the multimodal content features corresponding to the synchronization data of the target image.
[0145] Then, in the above step S106, the server fuses the multimodal content features corresponding to the synchronization data of each target image to determine the fusion features corresponding to the synchronization data of the target image. Then, the fusion features of the synchronization data of each target image are used as the fusion features of the game video.
[0146] In the above step S108, in order to obtain a code framework that better meets the user's code generation requirements, the main focus of the game to be developed can be prompted through preset prompt words, guiding the large model to use alternative game elements that meet the main focus as target game elements.
[0147] The server determines each predefined prompt word template, and determines the corresponding relationship between each prompt word template and the game type.
[0148] This manual does not limit the specific content of the prompt word template, which can be set according to the required game type and code framework generation requirements.
[0149] Different game types have different main focuses. For example, the main focus of role-playing games is character interaction and plot development, the main focus of racing games is car control and track generation, and the main focus of fighting games is combat strategy and character skills.
[0150] The prompt word template for a role-playing game can be set as follows: Analyze the character interactions and plot development in the following game clips, and determine the target game elements that describe the main character status and dialogue system. The prompt word template for a racing game can be set as follows: Based on the video features of the following racing game clips, infer the core logic of the car's physical control and track generation, and determine the corresponding target game elements. The prompt word template for a combat game can be set as follows: Extract key combat strategies and character skill mechanisms from the video features of a given multiplayer online tactical game clip, and determine the target game elements based on these mechanisms.
[0151] The server determines the game type corresponding to the game video, determines the prompt word template corresponding to the game type, and inputs the prompt word template and the video features of each game video into the big model, so that the big model determines each candidate game element, determines the target game elements that constitute the game to be developed from the candidate game elements, and generates the code framework of the game to be developed based on the target game elements.
[0152] This specification does not limit the specific method of determining the game type. The server can determine the game type selected by the user in response to the user's selection. Alternatively, the server can determine the game type corresponding to the game video through a trained classification model.
[0153] The classification model in this embodiment can be trained in the following manner. The server uses the game video containing the type annotation as a sample video, and determines the fusion features of the sample video through the above steps S100 to S106. The fusion features of the sample video are input into the classification model to be trained to obtain the predicted category of the classification model, and the classification model is trained according to the difference between the predicted category and the type annotation of the game video.
[0154] In the above step S108, in order to prevent the game developed based on the code framework generated by the large model from being duplicated with the existing game and affecting the game quality, the server can also perform a repeatability analysis on the generated code library framework.
[0155] Specifically, the server generates an alternative framework of the game to be developed based on the determined target game elements through the large model. Then, the repetition rate between the game developed through the alternative framework and each existing game is predicted. When it is determined that the repetition rate is less than a preset value, the alternative framework is used as the code framework of the game to be developed.
[0156] There are many ways to predict the repetition rate between the game developed by this alternative framework and existing games.
[0157] In one or more embodiments of the present specification, the server predicts the repetition rate by constructing a vector database.
[0158] The server determines the game elements included in each existing game, and then, for each existing game, determines a feature vector of the existing game according to the game elements included in the existing game.
[0159] This specification does not limit the specific method of determining the feature vector, and a variety of vectorization methods such as binary coding, frequency coding, and embedded coding can be selected.
[0160] In this embodiment, the server determines the feature vector corresponding to the candidate frame according to the target game element determined by the large model in step S108. The feature vector is determined in the same way as the feature vector of the selected existing game.
[0161] Then, the server uses the similarity between the feature vector corresponding to the candidate framework and the feature vector of each existing game as the predicted repetition rate between the game developed by the candidate framework and the existing games.
[0162] The specific calculation method of similarity is not limited in this specification, and cosine similarity calculation, Euclidean distance calculation, etc. can be selected.
[0163] In one or more embodiments of the present specification, the server predicts the repetition rate by constructing a graph database.
[0164] The server determines the game elements included in each existing game, and for each existing game, determines the corresponding logical structure diagram of the existing game based on the relationship between the game elements. The relationship between the game elements here can be determined manually or automatically generated based on the game elements through machine learning.
[0165] In this embodiment, the server inputs the target game elements determined by the big model in step S108 into the big model, so that the big model infers the relationship between the target game elements. The relationship between the target game elements may include multiple types, which can be set as needed, such as inclusion relationship, influence relationship, trigger relationship, etc.
[0166] The server determines element nodes according to each game element, determines edges between element nodes corresponding to each game element according to the relationship between each game element, and obtains a logical structure diagram corresponding to the alternative framework.
[0167] Figure 3 This is an example of a logical structure diagram provided in an embodiment of this specification. Figure 3 Taking the racing game as an example, a logical structure diagram is shown. Figure 3 The logical structure diagram of contains 7 element nodes, and the corresponding element features are racing cycle, collision check, car, acceleration, brake, speed, and posture. The edge types include influence relationship, inclusion relationship, attribute relationship, and action relationship.
[0168] Then, the server uses the similarity between the logical structure diagram corresponding to the alternative framework and the logical structure diagram of each existing game as the predicted repetition rate between the game developed by the alternative framework and the existing games.
[0169] The similarity in this embodiment can be determined by any graph similarity calculation method, for example, path similarity algorithms such as the shortest path algorithm and the full path algorithm, structural similarity algorithms such as graph edit distance and subgraph isomorphism, node similarity algorithms such as node similarity propagation (Node Similarity Propagation), page ranking (PageRank, PR), and community detection algorithms such as the Louvain algorithm and the label propagation algorithm (Label Propagation).
[0170] In the above embodiment, the game elements of each existing game can be collected manually. Alternatively, if the game code of each existing game can be obtained by legal means, the server can analyze the grammatical structure of each game code, extract the game elements of each existing game according to the grammatical structure of the game code of each existing game, and improve the efficiency of code framework generation.
[0171] On the basis of this embodiment, when the server retrieves that the repetition rate of each existing game and the candidate framework generated in step S104 is not less than the preset value, the candidate framework can be optimized through the large model and iterative optimization to determine the code framework, so as to ensure that innovative games can be developed through the code framework.
[0172] First, for each round of iteration, the server determines the candidate framework obtained in the previous round of iteration, and regards existing games whose repetition rate with the candidate framework obtained in the previous round of iteration is not less than a preset value as similar games.
[0173] Secondly, the server inputs the alternative framework and similar games obtained from the previous round of iteration into the big model, so that the big model analyzes the similarities between the alternative framework and the similar games, improves the similarities in the alternative framework, regenerates the alternative framework, and obtains the updated alternative framework for this round of iteration.
[0174] Then, the server compares the code framework updated by the iteration process with each existing game to determine whether the repetition rate between the code framework updated by the iteration process and each existing game is less than the preset value. If so, the iteration process is stopped and the candidate framework updated by the iteration process is used as the code framework. If not, the next iteration process is continued.
[0175] The above is the game code framework generation method provided in this specification. Based on the same idea, this specification also provides a corresponding game code framework generation device, such as Figure 4 shown.
[0176] Figure 4 A schematic diagram of a game code framework generation device provided in this specification, specifically comprising:
[0177] An acquisition module 200 is used to acquire game videos of at least two games;
[0178] A content data determination module 202 is used to determine, for each game video, content data of multiple modes of the game video according to the game video;
[0179] The content feature determination module 204 is used to determine the content features of each mode of the game video according to the content data of each mode;
[0180] A fusion module 206 is used to fuse the content features of each modality to determine the fusion features of the game video;
[0181] The generation module 208 is used to input the fusion features of each game video into the big model, so that the big model determines each candidate game element, and determines the target game element constituting the game to be developed from the candidate game elements, and generates the code framework of the game to be developed based on the target game element.
[0182] Optionally, the content data of the multiple modalities include content data of image modality, and the content data determination module 202 is specifically used to input each video frame contained in the game video into a recognition model, identify specific targets in the each video frame, determine each target image based on the identified video frames containing the specific targets, and use the each target image as the content data of the image modality of the game video.
[0183] Optionally, the content data of the multiple modalities include content data of text modality, and the content data determination module 202 is specifically used to determine the target text according to the subtitles contained in the game video, and use the target text as the content data of the text modality of the game video.
[0184] Optionally, the content data of the multiple modalities include content data of an audio modality, and the content data determination module 202 is specifically used to extract the audio data in the game video, perform text conversion on the audio data, and obtain the converted text of the audio data as the content data of the audio modality of the game video.
[0185] Optionally, the content data of the multiple modalities include content data of image modality, and the content feature determination module 204 is specifically used to determine each target image included in the content data of the image modality, and determine the image features of each target image, cluster the target images according to the image features, and determine the content features of the game video image modality according to the clustering results.
[0186] Optionally, the content data of the multiple modalities include content data of text modality, and the content feature determination module 204 is specifically used to segment the content data of the text modality into multiple text segments according to preset segmentation conditions, input each text segment into a topic model, obtain the topic classification results of the topic model for each text segment, and determine the content features of the game video text modality based on the topic classification results.
[0187] Optionally, the generation module 208 is specifically used to generate an alternative framework of the game to be developed based on the target game elements, predict the repetition rate between the game developed by using the alternative framework and each existing game, and when the repetition rate is less than a preset value, use the alternative framework as the code framework of the game to be developed.
[0188] This specification also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 Provides a method for generating game code framework.
[0189] This manual also provides Figure 5 The schematic structure diagram of the electronic device shown in FIG. Figure 5 As mentioned above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 Of course, in addition to the software implementation, this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0190] For the improvement of a technology, it can be clearly distinguished whether it is a hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or a software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0191] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0192] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0193] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0194] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0195] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0196] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0197] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0198] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0199] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0200] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. 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 disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0201] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0202] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0203] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0204] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0205] The above description is only an embodiment of this specification and is not intended to limit this specification. For those skilled in the art, this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification should be included in the scope of the claims of this application.
Claims
1. A method for generating a game code framework, characterized in that: include: Get gameplay videos of at least two games; For each game video, determine content data of multiple modes of the game video according to the game video; Determine the content features of each mode of the game video according to the content data of each mode; Fusion the content features of each modality to determine the fusion features of the game video; The fusion features of each game video are input into the big model, so that the big model determines each candidate game element, and determines the target game elements constituting the game to be developed from the candidate game elements, and generates the code framework of the game to be developed based on the target game elements.
2. The method according to claim 1, characterized in that The content data of the plurality of modalities include content data of an image modality; According to the game video, content data of multiple modes of the game video is determined, specifically including: Inputting each video frame included in the game video into a recognition model to recognize a specific target in each video frame; Determining each target image according to the identified video frame containing the specific target; The target images are used as content data of the image mode of the game video.
3. The method according to claim 1, characterized in that The content data of the multiple modalities include content data of text modality; According to the game video, content data of multiple modes of the game video is determined, specifically including: Determine the target text according to the subtitles contained in the game video; The target text is used as content data of the text mode of the game video.
4. The method according to claim 1, characterized in that The content data of the multiple modalities include content data of audio modality; According to the game video, content data of multiple modes of the game video is determined, specifically including: Extract the audio data from the game video; The audio data is converted into text to obtain the converted text of the audio data as the content data of the audio mode of the game video.
5. The method according to claim 1, characterized in that The content data of the plurality of modalities include content data of an image modality; According to the content data of each mode, the content features of each mode of the game video are determined, including: Determine each target image included in the content data of the image modality, and determine image features of each target image; Clustering the target images according to the features of the images; According to the clustering results, the content characteristics of the game video image modality are determined.
6. The method according to claim 1, characterized in that The content data of the multiple modalities include content data of text modality; According to the content data of each mode, the content features of each mode of the game video are determined, including: According to a preset segmentation condition, the content data of the text modality is segmented into a plurality of text segments; Input each text segment into a topic model to obtain a topic classification result of each text segment by the topic model; According to the topic classification result, the content characteristics of the game video text mode are determined.
7. The method according to claim 1, characterized in that According to the target game elements, a code framework of the game to be developed is generated, specifically including: Generating an alternative framework of the game to be developed according to the target game elements; Predicting the duplication rate between games developed by the alternative framework and existing games; When the repetition rate is less than a preset value, the candidate framework is used as the code framework of the game to be developed.
8. A game code framework generating device, characterized in that: include: An acquisition module is used to acquire game videos of at least two games; A content data determination module, for each game video, determines content data of multiple modes of the game video according to the game video; A content feature determination module, which determines the content features of each mode of the game video according to the content data of each mode; A fusion module, which fuses the content features of each modality to determine the fusion features of the game video; The generation module inputs the fusion features of each game video into the big model, so that the big model determines each candidate game element, and determines the target game elements constituting the game to be developed from the candidate game elements, and generates the code framework of the game to be developed based on the target game elements.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. 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 program, the method according to any one of claims 1 to 7 is implemented.