A method, device and equipment for generating a scene element in a game, and a storage medium

CN117046112BActive Publication Date: 2026-09-25NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311031815.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-16
Publication Date
2026-09-25
Estimated Expiration
2043-08-16

AI Technical Summary

Technical Problem

但是,以背景音乐为例,用户只能从现有的可选音乐(关卡编辑器中提供的可选背景音乐或是从外部音乐播放软件中自行下载的音乐)中选择待添加的背景音乐,从而使得用户需要花费大量时间去挑选符合自定义关卡场景设计风格的背景音乐,并且由于现有的可选音乐都是已经制作完成的音乐,因此,即使用户花费大量时间去挑选,可能仍然无法挑选到符合需求的目标背景音乐

Benefits of technology

[0019]本申请实施例提供的一种游戏中场景元素的生成方法、装置、设备及存储介质,从自定义关卡场景中,确定目标关卡场景;获取目标关卡场景对应的目标关卡参数;将目标关卡参数输入至目标模型,以从目标模型接收输出的目标场景元素数据;基于所述目标场景元素数据,生成与所述目标关卡场景对应的目标场景元素。通过这种方式,本申请可以根据用户设计的自定义关卡场景的场景特征,为用户自动生成符合上述场景特征的定制化场景元素,节约用户挑选定制化场景元素的时间,提高用户对于自定义关卡场景的制作效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117046112B_ABST
    Figure CN117046112B_ABST
Patent Text Reader

Abstract

The application provides a game scene element generation method and device, equipment and storage medium, the generation method comprises: determining a target level scene from a custom level scene; obtaining target level parameters corresponding to the target level scene; inputting the target level parameters into a target model to receive output target scene element data from the target model; and generating target scene elements corresponding to the target level scene based on the target scene element data. In this way, the application can automatically generate customized scene elements that meet the scene characteristics of the custom level scene designed by the user, saving the user time in selecting customized scene elements and improving the user's production efficiency for the custom level scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of game production technology, and more specifically, to a method, apparatus, device, and storage medium for generating scene elements in a game. Background Technology

[0002] With the rise of the UGC (User Generated Content) concept, more and more games support users to design their own game levels and allow users to share their created game levels with other players, which not only increases user participation but also enriches game content.

[0003] Currently, after users complete their custom level scenes based on common scene elements (such as track components for building game tracks, placed props, and set obstacles), they can add customized scene elements (such as background music and ambient lighting) to enrich the scene settings. However, taking background music as an example, users can only choose from existing available music (background music provided in the level editor or music downloaded from external music playback software). This requires users to spend a lot of time selecting background music that matches the design style of their custom level scene. Furthermore, since the existing available music is all pre-made, even if users spend a lot of time selecting, they may still not be able to find the target background music that meets their needs. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide a method, apparatus, device and storage medium for generating scene elements in a game, so as to automatically generate customized scene elements that conform to the scene characteristics of the user-designed custom level scene, save the user's time in selecting customized scene elements and improve the user's efficiency in creating custom level scenes.

[0005] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings.

[0006] In a first aspect, embodiments of this application provide a method for generating scene elements in a game, wherein the game includes preset level scenes and custom level scenes, the custom level scenes being level scenes generated in response to user editing, and the generation method includes:

[0007] From the custom level scenarios, determine the target level scenario;

[0008] Obtain the target level parameters corresponding to the target level scene. The target level parameters are used to characterize at least the level duration, level difficulty, and number of level props deployed for the target level scene.

[0009] The target level parameters are input into the target model to receive the output target scene element data from the target model; wherein, the target model is trained in advance using the level parameters and corresponding scene element data corresponding to the preset level scene;

[0010] Based on the target scene element data, target scene elements corresponding to the target level scene are generated.

[0011] Secondly, embodiments of this application provide a device for generating scene elements in a game, wherein the game includes preset level scenes and custom level scenes, the custom level scenes being level scenes generated in response to user editing, and the generation device includes:

[0012] The determination module is used to determine the target level scene from the custom level scene;

[0013] The acquisition module is used to acquire the target level parameters corresponding to the target level scene. The target level parameters are used to characterize at least the level duration, level difficulty, and number of level props deployed for the target level scene.

[0014] The conversion module is used to input the target level parameters into the target model, and to receive the output target scene element data from the target model; wherein, the target model is trained in advance using the level parameters and corresponding scene element data corresponding to the preset level scene;

[0015] The generation module is used to generate target scene elements corresponding to the target level scene based on the target scene element data.

[0016] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method for generating scene elements in a game.

[0017] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the above-described method for generating scene elements in a game.

[0018] The technical solutions provided by the embodiments of this application may include the following beneficial effects:

[0019] This application provides a method, apparatus, device, and storage medium for generating scene elements in a game. The method involves: determining a target level scene from a custom level scene; obtaining target level parameters corresponding to the target level scene; inputting the target level parameters into a target model to receive output target scene element data from the target model; and generating target scene elements corresponding to the target level scene based on the target scene element data. In this way, this application can automatically generate customized scene elements that conform to the scene characteristics of a user-designed custom level scene, saving users time in selecting customized scene elements and improving the efficiency of creating custom level scenes. Attached Figure Description

[0020] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 A flowchart illustrating a method for generating scene elements in a game, as provided in an embodiment of this application, is shown.

[0022] Figure 2a A flowchart illustrating the first method for determining a target level scene provided in an embodiment of this application is shown;

[0023] Figure 2b This illustration shows a schematic diagram of the interface interaction for selecting a target level scene according to an embodiment of this application;

[0024] Figure 3a A flowchart illustrating a second method for determining a target level scene provided in an embodiment of this application is shown.

[0025] Figure 3b This illustration shows a schematic diagram of the interface interaction for selecting a target level scene according to an embodiment of this application;

[0026] Figure 4 A flowchart illustrating the first method for outputting target scene element data provided in an embodiment of this application is shown.

[0027] Figure 5 A flowchart illustrating a second method for outputting target scene element data provided in an embodiment of this application is shown.

[0028] Figure 6 A flowchart illustrating a method for training a target model according to an embodiment of this application is shown;

[0029] Figure 7 A schematic diagram of the structure of a device for generating scene elements in a game, provided in an embodiment of this application, is shown.

[0030] Figure 8 This is a schematic diagram of the structure of an electronic device 800 provided in an embodiment of this application. Detailed Implementation

[0031] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0032] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0033] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.

[0034] Currently, after users complete the construction of a custom level scene based on common scene elements, they can add customized scene elements to enrich the scene settings. However, taking background music as an example, users can only select background music from the existing available music selections. This requires users to spend a lot of time choosing background music that matches the design style of the custom level scene. Furthermore, since the existing available music is all pre-produced music, even if users spend a lot of time selecting, they may still not be able to find the target background music that meets their needs.

[0035] Based on this, embodiments of this application provide a method, apparatus, device, and storage medium for generating scene elements in a game, so as to automatically generate customized scene elements that conform to the scene characteristics of the user-designed custom level scene, thereby saving the user's time in selecting customized scene elements and improving the user's efficiency in creating custom level scenes.

[0036] In one embodiment of this application, a method for generating scene elements in a game can run on a terminal device or a server; wherein the terminal device can be a local terminal device. When the method for generating scene elements in a game runs on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and client devices (i.e., terminal devices). Based on this, the specific device type of the electronic device running the above-described method for generating scene elements in a game is not limited in this embodiment.

[0037] To facilitate understanding of the embodiments of this application, a detailed description is provided below of a method, apparatus, device, and storage medium for generating scene elements in a game, as provided in the embodiments of this application.

[0038] Reference Figure 1 As shown, Figure 1 The diagram illustrates a flowchart of a method for generating scene elements in a game according to an embodiment of this application. The game includes preset level scenes and custom level scenes, where the custom level scenes are level scenes generated in response to user editing. The generation method includes steps S101-S104; specifically:

[0039] S101, determine the target level scene from the custom level scene.

[0040] S102, obtain the target level parameters corresponding to the target level scene.

[0041] S103, the target level parameters are input into the target model to receive the output target scene element data from the target model.

[0042] S104, Based on the target scene element data, generate target scene elements corresponding to the target level scene.

[0043] Based on the game scene element generation method provided in this application embodiment, a target level scene is determined from a custom level scene; target level parameters corresponding to the target level scene are obtained; the target level parameters are input into a target model to receive output target scene element data from the target model; and target scene elements corresponding to the target level scene are generated based on the target scene element data. In this way, this application can automatically generate customized scene elements that conform to the scene characteristics of the user-designed custom level scene, saving users time in selecting customized scene elements and improving the efficiency of creating custom level scenes.

[0044] The following is an exemplary description of each step in the method for generating scene elements in the game provided in the embodiments of this application:

[0045] S101, determine the target level scene from the custom level scene.

[0046] In this embodiment of the application, the game includes preset level scenes (equivalent to general level scenes provided by the game's official platform to users) and user-created custom level scenes; wherein, users can create the above-mentioned custom level scenes through the level editor (equivalent to the above-mentioned custom level scenes being level scenes generated in response to user editing, rather than general level scenes provided by the game's official platform).

[0047] Here, the level editor is a tool for users to create custom level scenes. In the level editor, users can select various scene elements (such as track components for building game tracks, placed props, and set obstacles) to create their own designed level scenes. In addition, users can also open their pre-made historical level scenes (which are also user-created custom level scenes) in the level editor to edit their historical level scenes (such as adding background music, adding lighting, shadows, and other artistic effects).

[0048] Specifically, the aforementioned target level scene can be a portion of the game scene selected by the user from a pre-made custom level scene. The level editor displays a target virtual control for generating target scene elements. Before executing step S101, the user can open a pre-made custom level scene in the level editor and select the game scene from the custom level scene to which the target scene elements need to be added as the target level scene. After selecting the target level scene, the user can trigger the aforementioned target virtual control. At this time, the target electronic device (i.e., the electronic device running the method for generating game scene elements provided in this application embodiment) responds to the trigger operation on the target virtual control, determines the target level scene from the custom level scene, and automatically executes subsequent steps S102-S104 to generate the target scene elements corresponding to the target level scene (i.e., the target electronic device responds to the trigger operation on the target virtual control and can automatically execute the generation method described in steps S101-S104).

[0049] It should be noted that the user-created custom level scenes can be either 2D (two-dimensional) or 3D (three-dimensional) game levels; that is, the target level scene selected from the custom level scenes can be either a 2D game scene or a 3D game scene; this application embodiment does not limit the specific game type to which the custom level scene belongs (equivalent to the game in this application embodiment being either a 2D game or a 3D game, and there is no need to limit the specific game type).

[0050] It should be noted that the aforementioned target virtual control can be displayed at any position in the level editor. The specific shape of the aforementioned target virtual control can be a circle, a star, or other irregular custom shape. This application embodiment does not limit the specific display position and specific display form of the aforementioned target virtual control in the level editor.

[0051] It should be noted that when the target electronic device is of a different type, the user's trigger operation on the target virtual control can correspond to a different type of operation. For example, when the user opens the card editor on a mobile terminal (e.g., a mobile phone, tablet, etc.) (equivalent to the target electronic device being a mobile terminal), the trigger operation can be a touch operation on the target virtual control (e.g., click operation, long press operation, swipe operation, etc.), or a non-touch operation such as a gesture control operation floating on the interface. When the user opens the card editor on a fixed terminal (e.g., a personal computer) (equivalent to the target electronic device being a fixed terminal), the trigger operation can be a mouse click operation on the target virtual control. This application embodiment does not limit the specific operation type to which the trigger operation belongs.

[0052] S102, obtain the target level parameters corresponding to the target level scene.

[0053] Here, the aforementioned target level parameters are parameter information used to reflect the scene characteristics in the target level scene; among them, the target level parameters are used to characterize at least the level duration, level difficulty, and number of level props deployed corresponding to the target level scene.

[0054] Specifically, taking a target level scenario belonging to a racing game as an example (i.e., the aforementioned custom level scenario is a UGC game level designed by the user within a racing game), in a racing game, the target level parameters can specifically include: track parameter information of the specific obstacle course in the target level scenario (falling off the obstacle course results in failure; the width and number of curves of the obstacle course are all track parameter information), the level duration corresponding to the target level scenario (the level duration is also the time limit for passing the level; if the player successfully passes the aforementioned obstacle course within the time limit, the level is considered successful), the target level... The specific obstacles used in the card scene (i.e., virtual obstacles used to hinder players and increase the difficulty of the level in the challenge track; when players encounter obstacles, they can jump, dodge, and turn to overcome them) and specific virtual props placed in the target level scene (players can pick up virtual props encountered in the game scene; when picking up different types of virtual props, players can use different types of prop effects such as speeding up movement and slowing down movement); wherein, the above-mentioned virtual props and obstacles are all dropable level props, and this application embodiment does not limit the specific type of level props.

[0055] It should be noted that the difficulty of a level is influenced by many factors. For example, the width and number of curves in the track parameters mentioned above directly affect the difficulty of the target level (the wider the track, the lower the difficulty; the fewer the curves, the lower the difficulty). The level duration and the number of obstacles deployed also affect the level difficulty to some extent (e.g., the longer the level duration, the lower the difficulty; and the fewer obstacles deployed, the lower the difficulty). This application does not limit the specific parameters corresponding to the level difficulty in the target level parameters.

[0056] Therefore, it should be noted that when creating custom level scenarios, based on the basic settings of the game (e.g., the basic settings of the aforementioned racing game are: players need to successfully overcome the obstacles placed in the track of each game level within a certain time limit to succeed in the level, otherwise they fail; during the level, players can pick up different types of virtual items), the custom level scenario must at least include the aforementioned level parameters related to the specific settings of the scenario, such as level duration, level difficulty, and the number of level items (that is, the aforementioned target level parameters are at least used to represent the level duration, level difficulty, and number of level items corresponding to the target level scenario). The specific setting of each level parameter information (e.g., the specific number and specific placement of the obstacles in the track, the specific value of the aforementioned time limit, etc.) is up to the user's design freedom.

[0057] S103, the target level parameters are input into the target model to receive the output target scene element data from the target model.

[0058] Here, the target model is used to extract the scene features of the target level scene from the above-mentioned input target level parameters, and output a digital sequence representing the scene features of the target level scene based on the extracted scene features. At this time, the above-mentioned digital sequence output by the target model is equivalent to the scene features of the target level scene represented in digital form, and is also equivalent to the target scene element data that matches the scene features of the target level scene.

[0059] Specifically, in step S103, although the target scene element data output by the target model can all be represented as a digital sequence in the underlying data, the data types they represent at the application level can be different; for example, the target scene element data can be an audio digital signal used to generate background music, or it can be a set of spherical harmonic coefficients used to generate ambient light.

[0060] Based on this, when performing step S103, as an optional embodiment, the target level parameters are input to the target model, and at least the audio digital signal or spherical harmonic coefficient set that matches the target level parameters can be received from the target model as target scene element data.

[0061] Here, the target model is trained in advance using the level parameters (such as level duration, level difficulty, number of level props) and the corresponding scene element data (such as the audio digital signal corresponding to the background music, or the set of spherical harmonic coefficients corresponding to the ambient light) of the preset level scene. The specific training method of the target model will not be elaborated here.

[0062] S104, Based on the target scene element data, generate target scene elements corresponding to the target level scene.

[0063] Here, unlike the target level parameters in step S102 above, the target scene elements represent customized scene elements that the user can freely add in the target level scene (i.e., the specific element content represented by the target scene elements is not limited by the game type); wherein, the target scene elements can at least represent the target background music played in the target level scene, or the target ambient light applied in the target level scene. The specific element content represented by the target scene elements is not limited in this embodiment.

[0064] Specifically, in the embodiments of this application, since the above-mentioned target scene elements are generated based on the target scene element data output by the target model (that is, the element features of the above-mentioned target scene elements can be represented in the form of a numerical sequence), in an optional implementation, the above-mentioned target scene elements can be target background music (at this time, the above-mentioned target scene element data is equivalent to an audio digital signal, and the specific numbers in the target scene element data are equivalent to audio sampling points in the audio digital signal).

[0065] In another alternative implementation, the target scene element can also be the target ambient light (in this case, the target scene element data is equivalent to the spherical harmonic coefficient set, the specific numbers in the target scene element data are equivalent to the coefficients in the spherical harmonic coefficient set, and each coefficient in the spherical harmonic coefficient set is used to represent different lighting directions and lighting intensities in the target ambient light).

[0066] Based on this, in the embodiments of this application, the above-mentioned target scene elements can at least represent: target background music or target ambient light. That is, since background music and ambient light are both scene elements whose own characteristics are suitable for representation in the form of digital sequences, the generation method described in steps S101-S104 of the embodiments of this application is at least applicable to generating target background music or target ambient light that conforms to the scene design style (i.e. scene characteristics) for the target level scene selected by the user.

[0067] The specific implementation process of each of the above steps in the embodiments of this application will be described in detail below:

[0068] Regarding the specific implementation process of step S101 above, since custom level scenes can belong to either 2D or 3D games, this application embodiment provides at least the following two different optional implementation methods to perform step S101 for custom level scenes belonging to different game types:

[0069] Here, when the custom level scene belongs to a 2D game, in the first optional implementation method, such as... Figure 2a As shown, Figure 2a This diagram illustrates a flowchart of a first method for determining a target level scene according to an embodiment of this application. When executing step S101, the method includes steps S201-S203, specifically:

[0070] S201, Display the game scene of the custom level scene in the level editor.

[0071] Specifically, Figure 2b This illustration shows a schematic diagram of the interface interaction for selecting a target level scene according to an embodiment of this application. Figure 2b As shown, the target electronic device provides a graphical user interface 200, in which a level editor 210 is displayed. The user can open a pre-made custom level scene in the level editor 210. At this time, as... Figure 2b As shown, the level editor 210 displays the game scene screen of the custom level scene. The game scene screen displays the challenge track designed by the user in the custom level scene, as well as the obstacles placed by the user in the challenge track.

[0072] S202, in response to a sliding operation starting from the first position in the game scene screen, control the game scene screen displayed in the level editor to change in accordance with the sliding operation.

[0073] Specifically, such as Figure 2bAs shown, the target electronic device responds to the user's sliding operation starting at the first position 211 in the game scene screen, and controls the game scene screen displayed in the level editor 210 to change following the sliding operation until the sliding operation ends.

[0074] It should be noted that the first position can be any position in the game scene. This application embodiment does not limit the specific starting position of the user's selected sliding operation (i.e., the first position mentioned above).

[0075] It should be noted that the sliding direction of the above sliding operation can be arbitrary. For example, the above sliding operation can be as follows: Figure 2b The horizontal sliding operation shown can also be a vertical sliding operation. This application embodiment does not limit the specific sliding direction of the above sliding operation.

[0076] S203, in response to the end of the sliding operation, determine the end position of the sliding operation in the game scene screen as the second position, and obtain the game scene located between the first position and the second position from the custom level scene as the target level scene.

[0077] Specifically, such as Figure 2b As shown, when the target electronic device responds to the end of the above sliding operation, it determines the end position of the sliding operation in the game scene screen as the second position 212. At this time, the target electronic device can determine the game scene between the first position 211 and the second position 212 from the custom level scene as the target level scene.

[0078] Here, when the custom level scene belongs to a 3D game, in the second optional implementation method, such as Figure 3a As shown, Figure 3a This illustration shows a flowchart of a second method for determining a target level scene according to an embodiment of this application. When executing step S101, the method includes steps S301-S302, specifically:

[0079] S301, Display the global game map of the custom level scene in the level editor.

[0080] Specifically, Figure 3b This illustration shows a schematic diagram of the interface interaction for selecting a target level scene according to an embodiment of this application. Figure 3b As shown, the target electronic device provides a graphical user interface 200, in which a level editor 210 is displayed. The user can open a pre-made custom level scene in the level editor 210. At this time, as... Figure 3bAs shown, the level editor 210 displays a global game map of the custom level scene. The global game map displays the complete challenge track designed by the user for the custom level scene, multiple obstacles placed by the user on the challenge track, and virtual props (which can be picked up by the player) placed by the user around the challenge track.

[0081] S302, in response to the selection operation on the global game map, obtain the game scene within the selection range of the selection operation from the custom level scene as the target level scene.

[0082] Specifically, such as Figure 3b As shown, the target electronic device responds to the user's selection operation on the global game map and can directly obtain the game scene within the selection range of 300 from the custom level scene as the target level scene.

[0083] Here, considering that when a user selects a region on the global game map, due to the limitations of the selection tool (e.g., a rectangular selection tool can only select a rectangular area as the selection range), there may be redundant parts in the selected range that need to be deleted; based on this, in this embodiment of the application, as an optional embodiment, the level editor can also display a range editing tool, so that after performing the above step S302, the user can use the range editing tool to edit the selected range of the current selection operation (e.g., delete part of the game scene content within the currently selected range, or expand the currently selected range along a certain direction on the global game map, etc.), so that the game scene within the range after range editing is used as the final target level scene.

[0084] Regarding the specific implementation process of step S103 above, when the target scene element data output by the target model belongs to an audio digital signal, such as Figure 4 As shown, Figure 4 This diagram illustrates a flowchart of a first method for outputting target scene element data according to an embodiment of this application. When executing step S103, the method includes steps S401-S402, specifically:

[0085] S401, the target level parameters are input into the target model, and the target model extracts the first scene features and the second scene features of the target level scene from the target level parameters.

[0086] Here, when the target scene element data output by the target model belongs to the audio digital signal (i.e., the expected target scene factor is the target background music), based on the signal characteristics of the audio digital signal, including signal length and signal pitch variation (i.e. signal fluctuation), the first scene feature described above represents the scene feature information of the target level scene that can affect the signal length of the output audio digital signal; the second scene feature described above represents the scene feature of the target level scene that can affect the signal fluctuation of the output audio digital signal (that is, the target model needs to extract at least the scene features of the signal length and signal fluctuation that can affect the output audio digital signal from the input target level parameters).

[0087] Specifically, taking the target level scene as a racing game as an example, referring to the target level parameters given in step S102 above, the first scene feature that can affect the signal length of the output audio digital signal in step S401 may include at least one of the following:

[0088] 1. The length characteristics of the challenge track; the longer the challenge track, the longer the signal length of the audio digital signal output by the target model.

[0089] 2. The distribution characteristics of obstacles in the obstacle course; among them, the sparser the distribution of obstacles in the obstacle course, the longer the signal length of the audio digital signal output by the target model.

[0090] 3. Time characteristics of clearance time limit; among them, the longer the clearance time limit, the longer the signal length of the audio digital signal output by the target model.

[0091] Specifically, taking the target level scene as a racing game as an example, referring to the target level parameters given in step S102 above, the second scene feature that can affect the signal fluctuation (i.e., signal high / low changes) of the output audio digital signal in step S401 may include at least one of the following:

[0092] 1. Complexity characteristics of the challenge track; the higher the complexity of the challenge track (e.g., more curves, narrow track, difficult to pass, etc.), the greater the signal fluctuation of the audio digital signal output by the target model (i.e., the more frequent the signal high and low changes).

[0093] 2. Obstruction characteristics of obstacles; among them, the higher the obstruction of obstacles (e.g., the more obstacles there are, the more difficult it is to avoid them), the greater the signal fluctuation of the audio digital signal output by the target model (i.e., the more frequent the signal changes in pitch).

[0094] 3. The fun characteristics of obstacles; among them, the higher the fun of the obstacle placement (e.g., more types of obstacles, adjacent obstacles requiring users to take different avoidance methods, etc.), the greater the signal fluctuation of the audio digital signal output by the target model (i.e., the more frequent the signal high and low changes).

[0095] 4. The density characteristics of virtual props; among them, the denser the virtual props are placed in the target level scene, the greater the signal fluctuation of the audio digital signal output by the target model (i.e., the more frequent the signal high and low changes).

[0096] S402, based on the extracted first scene features and second scene features, the target model outputs an audio digital signal that matches the first scene features and second scene features as the target scene element data.

[0097] Specifically, since the extracted first scene features and second scene features are both scene features related to the signal characteristics of audio digital signals (e.g., signal length, signal fluctuations, etc.), the target scene element data output by the target model at this time belongs to the audio digital signal. Based on this target scene element data, target background music suitable for playback in the target level scene can be generated. Regarding the specific implementation process of step S103 above, when the target scene element data output by the target model belongs to the set of spherical harmonic coefficients, such as... Figure 5 As shown, Figure 5 This illustration shows a flowchart of a second method for outputting target scene element data according to an embodiment of this application. When executing step S103, the method includes steps S501-S502, specifically:

[0098] S501, the target level parameters are input into the target model, and the target model extracts the third scene features and the fourth scene features of the target level scene from the target level parameters.

[0099] Here, when the target scene element data output by the target model belongs to the spherical harmonic coefficient set (i.e., the expected target scene factor is the target ambient light), since the illumination change includes at least the illumination direction change and the illumination intensity change (i.e., each coefficient in the spherical harmonic coefficient set is used to represent different illumination directions and illumination intensities), the above-mentioned third scene feature characterizes the scene feature of the illumination direction represented by the spherical harmonic coefficient set that can affect the output in the target level scene; the above-mentioned fourth scene feature characterizes the scene feature of the illumination intensity represented by the spherical harmonic coefficient set that can affect the output in the target level scene (i.e., the target model at least needs to extract the scene features of the illumination direction and illumination intensity represented by the coefficients in the spherical harmonic coefficient set that can affect the output from the input target level parameters).

[0100] Specifically, taking the target level scene as an example of a racing game, since the light intensity and the audio digital signal fluctuations are similar, both showing changes in value, the fourth scene feature mentioned above can refer to the second scene feature in step S401 above. The repetition will not be repeated here.

[0101] Specifically, taking a racing game as an example, since the factors affecting the direction of light are quite complex (equivalent to the direction of light being affected by all scene features in the target level, only some scene features have a greater impact than others), it is difficult to exhaustively list all the third scene features that can affect the direction of light. In this case, the third scene feature information can at least include all the first scene features and all the second scene features given in step S401 above. As for other scene features that the third scene features may include, this application embodiment does not impose any limitations.

[0102] S502, based on the extracted third scene features and fourth scene features, the target model outputs a set of spherical harmonic coefficients that match the third scene features and fourth scene features as the target scene element data.

[0103] Specifically, since the extracted third and fourth scene features are both related to lighting changes (e.g., lighting direction, lighting intensity, etc.), the target scene element data output by the target model at this time belongs to the set of spherical harmonic coefficients. Based on this target scene element data, target ambient light suitable for the target level scene can be generated. Regarding the target model in step S103 above, such as... Figure 6 As shown, Figure 6 This diagram illustrates a flowchart of a method for training a target model according to an embodiment of this application. Before executing steps S101-S103, the method includes steps S601-S604, specifically:

[0104] S601, obtain the level parameters of multiple preset level scenes and the scene element data corresponding to each preset level scene.

[0105] Here, the method for obtaining the preset level scene is the same as the method for obtaining the target level scene in step S101 above, and the repetition will not be repeated here.

[0106] Here, the aforementioned scene element data is used to represent sample scene elements in a preset level scene in the form of a numerical sequence; wherein, similar to the target scene elements, the sample scene elements include at least: background music or ambient light; the specific element content represented by the sample scene elements is not limited in this embodiment.

[0107] Specifically, when the training model outputs scene element data of a specific type that belongs to audio digital signals, for each preset level scene, the real background music played in the preset level scene can be obtained first, and then the real background music can be converted from the time domain to the frequency domain (e.g., the real background music can be converted into a fast Fourier transform), and the converted real background music can be normalized to obtain the digital sequence representation result of the real background music (i.e., the audio digital signal corresponding to the real background music) as the scene element data corresponding to the preset level scene.

[0108] Specifically, when the training model outputs scene element data of a specific type belonging to the spherical harmonic coefficient set, for each preset level scene, the real spherical harmonic coefficient set corresponding to the real ambient light (which is equivalent to determining the lighting parameter information of the real ambient light) can be obtained based on the real ambient light actually displayed in the preset level scene as the aforementioned scene element data corresponding to the preset level scene.

[0109] S602, input the level parameters of each preset level scene into the encoder of the initial model, and obtain the information encoding result corresponding to each preset level scene through the output of the encoder.

[0110] Here, the initial model is the original model of the target model before it is trained. The initial model can be a model with encoding and decoding functions (e.g., a variational autoencoder model). The initial model includes at least one encoder and one decoder. This application embodiment does not limit the specific model structure of the initial model, the number of encoders and decoders included in the initial model.

[0111] S603, the encoder inputs the information encoding result corresponding to each preset level scene into the decoder of the initial model, and the decoder outputs the decoded digital sequence corresponding to each preset level scene.

[0112] Here, in the initial model, the encoder inputs the information encoding result corresponding to each preset level scene into the decoder. The decoder decodes each input information encoding result and outputs the decoded digital sequence corresponding to each preset level scene.

[0113] Specifically, when the acquired scene element data is the digital sequence representation of the real background music in step S601 above, the decoded digital sequence output by the decoder belongs to the audio digital signal; when the acquired preset level scene is the real spherical harmonic coefficient set in step S601 above, the decoded digital sequence output by the decoder belongs to the spherical harmonic coefficient signal.

[0114] S604, for each preset level scene, calculate the training loss between the decoded digital sequence corresponding to the preset level scene and the scene element data corresponding to the preset level scene, and adjust the model parameters of the initial model based on each calculated training loss, so as to obtain the initial model including the adjusted model parameters as the target model.

[0115] Specifically, when calculating the training loss between the decoded digital sequence and scene element data of the same preset level scene, the cross-entropy loss function can be used, or other loss functions can be used. This application embodiment does not limit the specific type of loss function used in the initial model.

[0116] Here, after completing step S604 (i.e., ending model training), several preset level scenarios can be selected from the multiple preset level scenarios used as model training data as model test data. Thus, after obtaining the decoded digital sequence output by the target model for the model test data, multiple objective model evaluation metrics are used to evaluate the difference between the decoded digital sequence output by the target model and the scene element data corresponding to the model test data, thereby obtaining the model evaluation result for the target model.

[0117] It should be noted that the above-mentioned model evaluation indexes are selected for different types of decoded digital sequences output by the target model. The specific index types represented by the above-mentioned model evaluation indexes are not limited in this application embodiment.

[0118] Specifically, when the decoded digital sequence output by the target model is an audio digital signal, the model evaluation metrics that can be selected include, but are not limited to: PSNR (Peak Signal to Noise Ratio), SNR (Signal to Interference plus Noise Ratio), and STOI (Short-Time Objective Intelligibility, a metric used to evaluate speech quality, mainly used to evaluate the degree of distortion of speech signals during transmission and the intelligibility under different noise environments).

[0119] Specifically, when the decoded digital sequence output by the target model belongs to the spherical harmonic coefficient set, the model evaluation metrics that can be selected include, but are not limited to: the number of spherical harmonic coefficients contained in the spherical harmonic coefficient set and the coherence of the spherical harmonic coefficients. Among them, the more spherical harmonic coefficients there are, the higher the accuracy and the richer the details of the ambient light description of the preset level scene (i.e., the preset level scene in the model test data) obtained based on the spherical harmonic coefficient set (i.e., the model output result of the target model) (equivalent to the more spherical harmonic coefficients there are, the more accurate the model output result of the target model is, and the better the model evaluation result of the target model is). The more coherent the spherical harmonic coefficients are (i.e., the better the coherence), the higher the quality of the ambient light description of the preset level scene obtained based on the spherical harmonic coefficient set (equivalent to the more coherent the spherical harmonic coefficients are, the more accurate the model output result of the target model is, and the better the model evaluation result of the target model is). If the spherical harmonic coefficients are incoherent, it means that the illumination color and brightness of the ambient light obtained based on the spherical harmonic coefficient set may be deviated, and the model evaluation result of the target model will be worse.

[0120] It should be noted that the coherence of spherical harmonic coefficients refers to the relationship between adjacent coefficients of a function. When calculating the coefficients of a spherical harmonic function (i.e., spherical harmonic coefficients), an important property must be satisfied: no coefficient should exceed half the value of its right-hand neighbor. This property ensures that there are no abrupt changes or jumps between spherical harmonic coefficients, avoiding the illumination information deviation problem that may be caused by incoherent coefficients. Here, adjacent coefficients refer to two coefficients that are adjacent to each other in a spherical harmonic function. For example, in a third-order spherical harmonic function, $Y_{3,1}$ and $Y_{3,-1}$, $Y_{3,0}$ and $Y_{3,1}$ are all considered adjacent coefficients.

[0121] Regarding the specific implementation process of step S104 above, when the target scene element is target background music (that is, the target scene element data belongs to audio digital signals), step S104 can be executed in the manner described in steps a1-a2:

[0122] Step a1: When the target scene element data belongs to the audio digital signal, the target scene element data is sampled to convert the target scene element data into a set of sampling points composed of audio sampling points.

[0123] Here, when the target scene element data is an audio digital signal, since the audio digital signal is not yet audio data that can be directly played in the target level scene (i.e., the audio digital signal cannot be directly applied to the target level scene), after obtaining the target scene element data, it is necessary to perform sampling processing on the target scene element data according to a certain sampling rate and sampling bit depth (i.e., sample processing on the audio digital signal), converting the numbers in the target scene element data into audio sampling points, thereby converting the target scene element data into a set of sampling points composed of audio sampling points.

[0124] It should be noted that when sampling the target scene element data, the specific values ​​of the sampling rate and the number of sampling bits can be set according to the actual application requirements. This application embodiment does not impose any limitations on the specific values ​​of the sampling rate and the number of sampling bits.

[0125] Step a2: Encode and store the audio sampling points in the sampling point set through a multimedia framework to generate target background music corresponding to the target level scene.

[0126] Here, the multimedia framework used can be the ffmpeg (an open-source multimedia processing tool) library, or other multimedia processing tools with encoding / decoding and storage functions; this application embodiment does not limit the specific tool type of the multimedia framework.

[0127] It should be noted that after obtaining the target background music, since the target background music is generated based on the scene characteristics in the target level scene, in the actual custom level scene, the target background music will only be played in a loop in the target level scene, rather than in the entire custom level scene.

[0128] For example, if a user generates a matching first background music M1 for the first level scene A in the custom level scene (that is, replaces the target level scene in steps S101-S104 with the first level scene A and replaces the target background music with the first background music M1) and generates a matching second background music M2 for the second level scene B in the custom level scene (that is, replaces the target level scene in steps S101-S104 with the second level scene B and replaces the target background music with the second background music M2), then in the actual custom level scene, when the player is within the scene range of the first level scene A, the first background music M1 will be played in a loop for the player. When the player enters the second level scene B from the first level scene A, the background music will also transition from the first background music M1 to the second background music M2.

[0129] Regarding the specific implementation process of step S104 above, when the target scene element is the target ambient light (that is, the target scene element data belongs to the spherical harmonic coefficient set), step S104 can be executed in the manner described in step b1 below:

[0130] Step b1: When the target scene element data belongs to the spherical harmonic coefficient set, generate the target ambient light corresponding to the target level scene according to the illumination direction and illumination intensity represented by each coefficient in the spherical harmonic coefficient set.

[0131] Here, unlike the aforementioned audio digital signals, when the output target scene element data belongs to the spherical harmonic coefficient set, since each coefficient in the spherical harmonic coefficient set can represent different lighting directions and lighting intensities (i.e., each coefficient in the spherical harmonic coefficient set is equivalent to determining the specific lighting parameters of the target ambient light), the output spherical harmonic coefficient set can be directly applied to the target level scene (i.e., generating target ambient light suitable for the target level scene according to the lighting direction and lighting intensity represented by each coefficient in the spherical harmonic coefficient set), without the need for additional data format conversion.

[0132] For example, if the user generates a matching first ambient light L1 for the first level scene A in the custom level scene and a matching second ambient light L2 for the second level scene B in the custom level scene according to the generation method described in steps S101-S104 above, then in the actual custom level scene, when the player is within the scene range of the first level scene A, the ambient light displayed in the first level scene A is the first ambient light L1. When the player enters the second level scene B from the first level scene A, the displayed ambient light will also transition from the first ambient light L1 to the second ambient light L2.

[0133] Based on the game scene element generation method provided in this application embodiment, a target level scene is determined from a custom level scene; target level parameters corresponding to the target level scene are obtained; the target level parameters are input into a target model to receive output target scene element data from the target model; and target scene elements corresponding to the target level scene are generated based on the target scene element data. In this way, this application can automatically generate customized scene elements that conform to the scene characteristics of the user-designed custom level scene, saving users time in selecting customized scene elements and improving the efficiency of creating custom level scenes.

[0134] Based on the same inventive concept, this application also provides a device for generating game scene elements corresponding to the above-mentioned method for generating game scene elements. Since the principle of the generation device in this application is similar to the above-mentioned method for generating game scene elements in this application, the implementation of the generation device can refer to the implementation of the above-mentioned generation method, and the repeated parts will not be described again.

[0135] Reference Figure 7 As shown, Figure 7 The diagram illustrates a structural schematic of a device for generating scene elements in a game, as provided in an embodiment of this application. The game includes preset level scenes and custom level scenes, wherein the custom level scenes are level scenes generated in response to user editing. The generation device includes:

[0136] The determining module 701 is used to determine the target level scene from the custom level scene;

[0137] The acquisition module 702 is used to acquire the target level parameters corresponding to the target level scene, wherein the target level parameters are at least used to characterize the level duration, level difficulty and level prop quantity corresponding to the target level scene;

[0138] The conversion module 703 is used to input the target level parameters into the target model, so as to receive the output target scene element data from the target model; wherein, the target model is trained in advance using the level parameters and corresponding scene element data corresponding to the preset level scene;

[0139] The generation module 704 is used to generate target scene elements corresponding to the target level scene based on the target scene element data.

[0140] In one optional implementation, when determining the target level scene from the custom level scene, the determining module 701 is used to:

[0141] Display the game scene of the custom level scenario in the level editor;

[0142] In response to a sliding operation originating from a first position in the game scene screen, the game scene screen displayed in the level editor is controlled to change in accordance with the sliding operation;

[0143] In response to the end of the sliding operation, the end position of the sliding operation in the game scene screen is determined as the second position, and the game scene located between the first position and the second position is obtained from the custom level scene as the target level scene.

[0144] In an optional implementation, when determining the target level scene from the custom level scene, the determining module 701 is further configured to:

[0145] Display the global game map of the custom level scene in the level editor;

[0146] In response to a selection operation on the global game map, the game scene located within the selection area of ​​the selection operation is obtained from the custom level scene as the target level scene.

[0147] In an optional implementation, when the target level parameters are input into the target model to receive the output target scene element data from the target model, the conversion module 703 is configured to:

[0148] The target level parameters are input into the target model, and the audio digital signal or spherical harmonic coefficient set that matches the target level parameters is received from the target model as the target scene element data.

[0149] In an optional implementation, when generating target scene elements corresponding to the target level scene based on the target scene element data, the generation module 704 is used to:

[0150] When the target scene element data belongs to an audio digital signal, the target scene element data is sampled to convert the target scene element data into a set of sampling points composed of audio sampling points;

[0151] The audio sampling points in the sampling point set are encoded and stored using a multimedia framework to generate target background music corresponding to the target level scene.

[0152] In an optional implementation, when generating target scene elements corresponding to the target level scene based on the target scene element data, the generation module 704 is further configured to:

[0153] When the target scene element data belongs to the spherical harmonic coefficient set, target ambient light corresponding to the target level scene is generated according to the illumination direction and illumination intensity represented by each coefficient in the spherical harmonic coefficient set.

[0154] In one optional implementation, the generation apparatus further includes a model training module, which is used to train the target model using the following method:

[0155] The system acquires level parameters for multiple preset level scenarios and scene element data corresponding to each preset level scenario; wherein, the scene element data is used to represent sample scene elements in the preset level scenario in the form of a numerical sequence; the sample scene elements include at least: background music or ambient light;

[0156] The level parameters of each preset level scene are input into the encoder of the initial model, and the information encoding result corresponding to each preset level scene is obtained by the output of the encoder.

[0157] The encoder inputs the information encoding result corresponding to each preset level scene into the decoder of the initial model, and the decoder outputs the decoded digital sequence corresponding to each preset level scene.

[0158] For each preset level scenario, the training loss between the decoded digital sequence corresponding to the preset level scenario and the scene element data corresponding to the preset level scenario is calculated, and the model parameters of the initial model are adjusted based on each calculated training loss to obtain the initial model including the adjusted model parameters as the target model.

[0159] Based on the game scene element generation device provided in this application embodiment, a target level scene is determined from a custom level scene; target level parameters corresponding to the target level scene are obtained; the target level parameters are input to a target model to receive output target scene element data from the target model; and target scene elements corresponding to the target level scene are generated based on the target scene element data. In this way, this application can automatically generate customized scene elements that conform to the scene characteristics of a user-designed custom level scene, saving users time in selecting customized scene elements and improving the efficiency of creating custom level scenes.

[0160] Based on the same inventive concept, this application also provides an electronic device corresponding to the above-mentioned method for generating scene elements in the game. Since the principle of solving the problem by the electronic device in the embodiments of this application is similar to the above-mentioned method for generating scene elements in the game, the implementation of the electronic device can refer to the implementation of the above-mentioned generation method, and the repeated parts will not be described again.

[0161] Figure 8 A schematic diagram of the structure of an electronic device 800 provided in this application embodiment includes: a processor 801, a memory 802, and a bus 803. The memory 802 stores machine-readable instructions executable by the processor 801. When the electronic device runs a method for generating scene elements in a game as described in the embodiment, the processor 801 communicates with the memory 802 via the bus 803. The processor 801 executes the machine-readable instructions, and when the processor 801 executes the machine-readable instructions, it implements the following steps:

[0162] From the custom level scenarios, determine the target level scenario;

[0163] Obtain the target level parameters corresponding to the target level scene. The target level parameters are used to characterize at least the level duration, level difficulty, and number of level props deployed for the target level scene.

[0164] The target level parameters are input into the target model to receive the output target scene element data from the target model; wherein, the target model is trained in advance using the level parameters and corresponding scene element data corresponding to the preset level scene;

[0165] Based on the target scene element data, target scene elements corresponding to the target level scene are generated.

[0166] In one alternative implementation, when determining the target level scene from the custom level scene, the processor 801 is configured to:

[0167] Display the game scene of the custom level scenario in the level editor;

[0168] In response to a sliding operation originating from a first position in the game scene screen, the game scene screen displayed in the level editor is controlled to change in accordance with the sliding operation;

[0169] In response to the end of the sliding operation, the end position of the sliding operation in the game scene screen is determined as the second position, and the game scene located between the first position and the second position is obtained from the custom level scene as the target level scene.

[0170] In an alternative implementation, when determining the target level scene from the custom level scene, the processor 801 is further configured to:

[0171] Display the global game map of the custom level scene in the level editor;

[0172] In response to a selection operation on the global game map, the game scene located within the selection area of ​​the selection operation is obtained from the custom level scene as the target level scene.

[0173] In an optional implementation, when the target level parameters are input to the target model to receive output target scene element data from the target model, the processor 801 is configured to:

[0174] The target level parameters are input into the target model, and the audio digital signal or spherical harmonic coefficient set that matches the target level parameters is received from the target model as the target scene element data.

[0175] In an optional implementation, when generating target scene elements corresponding to the target level scene based on the target scene element data, the processor 801 is configured to:

[0176] When the target scene element data belongs to an audio digital signal, the target scene element data is sampled to convert the target scene element data into a set of sampling points composed of audio sampling points;

[0177] The audio sampling points in the sampling point set are encoded and stored using a multimedia framework to generate target background music corresponding to the target level scene.

[0178] In an optional implementation, when generating target scene elements corresponding to the target level scene based on the target scene element data, the processor 801 is further configured to:

[0179] When the target scene element data belongs to the spherical harmonic coefficient set, target ambient light corresponding to the target level scene is generated according to the illumination direction and illumination intensity represented by each coefficient in the spherical harmonic coefficient set.

[0180] In one alternative implementation, the processor 801 is used to train the target model using the following method:

[0181] The system acquires level parameters for multiple preset level scenarios and scene element data corresponding to each preset level scenario; wherein, the scene element data is used to represent sample scene elements in the preset level scenario in the form of a numerical sequence; the sample scene elements include at least: background music or ambient light;

[0182] The level parameters of each preset level scene are input into the encoder of the initial model, and the information encoding result corresponding to each preset level scene is obtained by the output of the encoder.

[0183] The encoder inputs the information encoding result corresponding to each preset level scene into the decoder of the initial model, and the decoder outputs the decoded digital sequence corresponding to each preset level scene.

[0184] For each preset level scenario, the training loss between the decoded digital sequence corresponding to the preset level scenario and the scene element data corresponding to the preset level scenario is calculated, and the model parameters of the initial model are adjusted based on each calculated training loss to obtain the initial model including the adjusted model parameters as the target model.

[0185] The electronic device provided in this application provides the following steps: First, a target level scene is determined from a custom level scene; then, target level parameters corresponding to the target level scene are obtained; the target level parameters are input into a target model to receive output target scene element data from the target model; finally, target scene elements corresponding to the target level scene are generated based on the target scene element data. In this way, this application can automatically generate customized scene elements that conform to the scene characteristics of the user-designed custom level scene, saving users time in selecting customized scene elements and improving the efficiency of creating custom level scenes.

[0186] Based on the same inventive concept, embodiments of this application also provide a computer-readable storage medium storing a computer program, which is executed by a processor, wherein the processor performs the following steps:

[0187] From the custom level scenarios, determine the target level scenario;

[0188] Obtain the target level parameters corresponding to the target level scene. The target level parameters are used to characterize at least the level duration, level difficulty, and number of level props deployed for the target level scene.

[0189] The target level parameters are input into the target model to receive the output target scene element data from the target model; wherein, the target model is trained in advance using the level parameters and corresponding scene element data corresponding to the preset level scene;

[0190] Based on the target scene element data, target scene elements corresponding to the target level scene are generated.

[0191] In one alternative implementation, when determining the target level scene from the custom level scene, the processor is configured to:

[0192] Display the game scene of the custom level scenario in the level editor;

[0193] In response to a sliding operation originating from a first position in the game scene screen, the game scene screen displayed in the level editor is controlled to change in accordance with the sliding operation;

[0194] In response to the end of the sliding operation, the end position of the sliding operation in the game scene screen is determined as the second position, and the game scene located between the first position and the second position is obtained from the custom level scene as the target level scene.

[0195] In an optional implementation, when determining the target level scene from the custom level scene, the processor is further configured to:

[0196] Display the global game map of the custom level scene in the level editor;

[0197] In response to a selection operation on the global game map, the game scene located within the selection area of ​​the selection operation is obtained from the custom level scene as the target level scene.

[0198] In an optional implementation, when the target level parameters are input to the target model to receive output target scene element data from the target model, the processor is configured to:

[0199] The target level parameters are input into the target model, and the audio digital signal or spherical harmonic coefficient set that matches the target level parameters is received from the target model as the target scene element data.

[0200] In one optional implementation, when generating target scene elements corresponding to the target level scene based on the target scene element data, the processor is configured to:

[0201] When the target scene element data belongs to an audio digital signal, the target scene element data is sampled to convert the target scene element data into a set of sampling points composed of audio sampling points;

[0202] The audio sampling points in the sampling point set are encoded and stored using a multimedia framework to generate target background music corresponding to the target level scene.

[0203] In an optional implementation, when generating target scene elements corresponding to the target level scene based on the target scene element data, the processor is further configured to:

[0204] When the target scene element data belongs to the spherical harmonic coefficient set, target ambient light corresponding to the target level scene is generated according to the illumination direction and illumination intensity represented by each coefficient in the spherical harmonic coefficient set.

[0205] In one alternative implementation, the processor is used to train the target model using the following method:

[0206] The system acquires level parameters for multiple preset level scenarios and scene element data corresponding to each preset level scenario; wherein, the scene element data is used to represent sample scene elements in the preset level scenario in the form of a numerical sequence; the sample scene elements include at least: background music or ambient light;

[0207] The level parameters of each preset level scene are input into the encoder of the initial model, and the information encoding result corresponding to each preset level scene is obtained by the output of the encoder.

[0208] The encoder inputs the information encoding result corresponding to each preset level scene into the decoder of the initial model, and the decoder outputs the decoded digital sequence corresponding to each preset level scene.

[0209] For each preset level scenario, the training loss between the decoded digital sequence corresponding to the preset level scenario and the scene element data corresponding to the preset level scenario is calculated, and the model parameters of the initial model are adjusted based on each calculated training loss to obtain the initial model including the adjusted model parameters as the target model.

[0210] Using the computer-readable storage medium provided in this application embodiment, a target level scene is determined from a custom level scene; target level parameters corresponding to the target level scene are obtained; the target level parameters are input into a target model to receive output target scene element data from the target model; and target scene elements corresponding to the target level scene are generated based on the target scene element data. In this way, this application can automatically generate customized scene elements that conform to the scene characteristics of a user-designed custom level scene, saving users time in selecting customized scene elements and improving the efficiency of creating custom level scenes.

[0211] In this embodiment, the computer-readable storage medium can also execute other machine-readable instructions when the processor runs, to perform the method for generating game scene elements as described in other embodiments. For details on the specific generation method steps and principles, please refer to the description of the method-side embodiment, which will not be repeated here.

[0212] In the embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. The system embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interface; the indirect coupling or communication connection between systems or units may be electrical, mechanical, or other forms.

[0213] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0214] In addition, the functional units in the embodiments provided in this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0215] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0216] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0217] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application. All should be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.

Claims

1. A method for generating scene elements in a game, characterized in that, The game includes preset level scenes and custom level scenes. The custom level scenes are level scenes generated in response to user editing. The generation method includes: From the custom level scenarios, determine the target level scenario; Obtain the target level parameters corresponding to the target level scene. The target level parameters are used to characterize at least the level duration, level difficulty, and number of level props deployed for the target level scene. The target level parameters are input into the target model to receive the output target scene element data from the target model; wherein, the target model is trained in advance using the level parameters and corresponding scene element data corresponding to the preset level scene; Based on the target scene element data, target scene elements corresponding to the target level scene are generated.

2. The generation method according to claim 1, characterized in that, Determining the target level scene from the custom level scenes includes: Display the game scene of the custom level scenario in the level editor; In response to a sliding operation originating from a first position in the game scene screen, the game scene screen displayed in the level editor is controlled to change in accordance with the sliding operation; In response to the end of the sliding operation, the end position of the sliding operation in the game scene screen is determined as the second position, and the game scene located between the first position and the second position is obtained from the custom level scene as the target level scene.

3. The generation method according to claim 1, characterized in that, The step of determining the target level scene from the custom level scene also includes: Display the global game map of the custom level scene in the level editor; In response to a selection operation on the global game map, the game scene located within the selection area of ​​the selection operation is obtained from the custom level scene as the target level scene.

4. The generation method according to claim 1, characterized in that, The step of inputting the target level parameters into the target model and receiving the output target scene element data from the target model includes: The target level parameters are input into the target model, and the audio digital signal or spherical harmonic coefficient set that matches the target level parameters is received from the target model as the target scene element data.

5. The generation method according to claim 4, characterized in that, The step of generating target scene elements corresponding to the target level scene based on the target scene element data includes: When the target scene element data belongs to an audio digital signal, the target scene element data is sampled to convert the target scene element data into a set of sampling points composed of audio sampling points; The audio sampling points in the sampling point set are encoded and stored using a multimedia framework to generate target background music corresponding to the target level scene.

6. The generation method according to claim 4, characterized in that, The step of generating target scene elements corresponding to the target level scene based on the target scene element data further includes: When the target scene element data belongs to the spherical harmonic coefficient set, target ambient light corresponding to the target level scene is generated according to the illumination direction and illumination intensity represented by each coefficient in the spherical harmonic coefficient set.

7. The generation method according to claim 1, characterized in that, The target model was obtained by training using the following method: The system acquires level parameters for multiple preset level scenarios and scene element data corresponding to each preset level scenario; wherein, the scene element data is used to represent sample scene elements in the preset level scenario in the form of a numerical sequence; the sample scene elements include at least: background music or ambient light; The level parameters of each preset level scene are input into the encoder of the initial model, and the information encoding result corresponding to each preset level scene is obtained by the output of the encoder. The encoder inputs the information encoding result corresponding to each preset level scene into the decoder of the initial model, and the decoder outputs the decoded digital sequence corresponding to each preset level scene. For each preset level scenario, the training loss between the decoded digital sequence corresponding to the preset level scenario and the scene element data corresponding to the preset level scenario is calculated, and the model parameters of the initial model are adjusted based on each calculated training loss to obtain the initial model including the adjusted model parameters as the target model.

8. A device for generating scene elements in a game, characterized in that, The game includes preset level scenes and custom level scenes, wherein the custom level scenes are level scenes generated in response to user editing, and the generation device includes: The determination module is used to determine the target level scene from the custom level scene; The acquisition module is used to acquire the target level parameters corresponding to the target level scene. The target level parameters are used to characterize at least the level duration, level difficulty, and number of level props deployed for the target level scene. The conversion module is used to input the target level parameters into the target model, and to receive the output target scene element data from the target model; wherein, the target model is trained in advance using the level parameters and corresponding scene element data corresponding to the preset level scene; The generation module is used to generate target scene elements corresponding to the target level scene based on the target scene element data.

9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the steps of the method for generating scene elements in a game as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the method for generating scene elements in a game as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Game scene generation method and device, storage medium and electronic device

    CN114288664A

  • Game resource allocation method and device based on bilateral adaptation, equipment and medium

    CN114733195A