Virtual scene construction method and device, electronic equipment and storage medium

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

Patent Information

Application Number
CN202311437770.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-31
Publication Date
2026-09-08
Estimated Expiration
2043-10-31

AI Technical Summary

Technical Problem

[0004]但是,相关技术中的场景制作方法会耗费较大的成本且耗时较多,并且当虚拟场景中的某一个区域出现漏洞时,很难精准排查出具体漏洞位置

Benefits of technology

[0018] As can be seen from the above, the virtual scene construction method, apparatus, electronic device, and storage medium provided in this application obtain multiple scene module planar images by stitching together pre-acquired unit pixel modules; perform 3D conversion operations on the scene module planar images based on scene information in the scene module planar images to construct multiple scene modules corresponding to the multiple scene module planar images; wherein, each scene module includes at least: a path; determining the path information corresponding to the path in each scene module; and obtaining scene requirement parameters, and stitching together the scene modules corresponding to the path information according to the scene requirement parameters to construct a target virtual scene. This application obtains scene module planar images by stitching together unit pixel modules, which allows for rapid changes to the scene design in the scene module planar images compared to changing the scene design in a 3D scene. Furthermore, by dividing the target virtual scene into multiple scene modules for separate editing, not only is the editing cost reduced, but multiple developers can also edit each scene module separately, thus shortening the editing cycle to a certain extent. Furthermore, by splicing different scene modules together, a complete target virtual scene can be obtained. Since the scene modules that can be spliced ​​together can be freely selected during the splicing process, the generation effect of the entire target virtual scene is more diversified. Different target virtual scenes can be spliced ​​together from multiple different scene modules in the same group, making the virtual scene richer and more diverse.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117398685B_ABST
    Figure CN117398685B_ABST
Patent Text Reader

Abstract

The application provides a virtual scene construction method and device, electronic equipment and storage medium. The method comprises the following steps: obtaining a plurality of scene module plan views by splicing unit pixel modules according to pre-acquired unit pixel modules; performing a 3D operation on the scene module plan views according to scene information in the scene module plan views to construct a plurality of scene modules corresponding to the plurality of scene module plan views; wherein each scene module at least comprises a path; determining path information corresponding to the path in each scene module; acquiring scene demand parameters, and splicing the scene modules corresponding to the path information according to the scene demand parameters to construct a target virtual scene. The method provided by the application divides the target virtual scene into a plurality of scene modules for editing respectively, which not only reduces the editing cost, but also allows multiple developers to edit each scene module respectively, thereby shortening the editing period to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, electronic device and storage medium for constructing virtual scenes. Background Technology

[0002] Virtual scenes are virtual spaces where players experience games. Game developers create game scenes in advance during the development phase. When players actually play the game, the pre-made scenes are loaded for players to experience.

[0003] In related technologies, virtual scenes are usually created as a whole, such as editing the entire scene screen by screen, and developers need to manually select and edit the paths for players to walk on based on the entire scene.

[0004] However, the scene creation methods in related technologies are costly and time-consuming, and when a vulnerability appears in a certain area of ​​the virtual scene, it is difficult to accurately pinpoint the specific location of the vulnerability. Summary of the Invention

[0005] In view of this, the purpose of this application is to provide a method, apparatus, electronic device and storage medium for constructing virtual scenes.

[0006] In view of the above objectives, in a first aspect, this application provides a method for constructing a virtual scene, the method comprising:

[0007] Multiple scene module planar images are obtained by stitching together pre-acquired unit pixel modules;

[0008] The scene module planar diagram is transformed into a 3D model based on the scene information in the scene module planar diagram to construct multiple scene modules corresponding to the multiple scene module planar diagrams; wherein each scene module includes at least: a path;

[0009] Determine the path information corresponding to the path in each scene module; and,

[0010] Obtain scene requirement parameters, and then splice the scene modules corresponding to the path information according to the scene requirement parameters to construct the target virtual scene.

[0011] In a second aspect, this application provides a virtual scene construction apparatus, the apparatus comprising:

[0012] The stitching module is configured to stitch together multiple scene module planar images based on pre-acquired unit pixel modules;

[0013] The 3D transformation module is configured to perform 3D transformation operations on the scene module planar diagram based on scene information in the scene module planar diagram to construct multiple scene modules corresponding to the multiple scene module planar diagrams; wherein, each scene module includes at least: a path;

[0014] The determination module is configured to determine the path information corresponding to the path in each scene module;

[0015] The construction module is configured to acquire scene requirement parameters and, based on the scene requirement parameters, splice together the scene modules corresponding to the path information to construct the target virtual scene.

[0016] In a third aspect, this application 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 executes the program to implement the virtual scene construction method as described in the first aspect.

[0017] In a fourth aspect, this application provides a computer-readable storage medium storing computer instructions for causing a computer to perform the virtual scene construction method as described in the first aspect.

[0018] As can be seen from the above, the virtual scene construction method, apparatus, electronic device, and storage medium provided in this application obtain multiple scene module planar images by stitching together pre-acquired unit pixel modules; perform 3D conversion operations on the scene module planar images based on scene information in the scene module planar images to construct multiple scene modules corresponding to the multiple scene module planar images; wherein, each scene module includes at least: a path; determining the path information corresponding to the path in each scene module; and obtaining scene requirement parameters, and stitching together the scene modules corresponding to the path information according to the scene requirement parameters to construct a target virtual scene. This application obtains scene module planar images by stitching together unit pixel modules, which allows for rapid changes to the scene design in the scene module planar images compared to changing the scene design in a 3D scene. Furthermore, by dividing the target virtual scene into multiple scene modules for separate editing, not only is the editing cost reduced, but multiple developers can also edit each scene module separately, thus shortening the editing cycle to a certain extent. Furthermore, by splicing different scene modules together, a complete target virtual scene can be obtained. Since the scene modules that can be spliced ​​together can be freely selected during the splicing process, the generation effect of the entire target virtual scene is more diversified. Different target virtual scenes can be spliced ​​together from multiple different scene modules in the same group, making the virtual scene richer and more diverse. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 A schematic diagram of the automated scene generation in related technologies is shown.

[0021] Figure 2 This illustration shows an exemplary application scenario diagram of a virtual scene construction method provided in an embodiment of this application.

[0022] Figure 3 An exemplary flowchart of a virtual scene construction method provided in an embodiment of this application is shown.

[0023] Figure 4 An exemplary schematic diagram of a unit pixel module according to an embodiment of this application is shown.

[0024] Figure 5 An exemplary schematic diagram of a scene module plan view according to an embodiment of this application is shown.

[0025] Figure 6 An exemplary schematic diagram of a refined scene module plan view according to an embodiment of this application is shown.

[0026] Figure 7(a) shows an exemplary schematic diagram of a refined scene module plan view containing the same number of intersections according to an embodiment of the present application.

[0027] Figure 7(b) shows an exemplary schematic diagram of another refined scene module plan view containing the same number of intersections according to an embodiment of the present application.

[0028] Figure 7(c) shows an exemplary schematic diagram of a further refined scene module plan view containing the same number of intersections according to an embodiment of the present application.

[0029] Figure 8 An exemplary schematic diagram of a white-box scene module according to an embodiment of this application is shown.

[0030] Figure 9 An exemplary schematic diagram of a virtual asset according to an embodiment of this application is shown.

[0031] Figure 10 An exemplary schematic diagram of a scene module according to an embodiment of this application is shown.

[0032] Figure 11An exemplary schematic diagram of a stitched, refined scene module plan view according to an embodiment of this application is shown.

[0033] Figure 12 An exemplary schematic diagram of a stitched white-box scene module according to an embodiment of this application is shown.

[0034] Figure 13 An exemplary schematic diagram of a stitched portion of a target virtual scene according to an embodiment of this application is shown.

[0035] Figure 14 An exemplary schematic diagram of the user interface of the test software according to an embodiment of this application is shown.

[0036] Figure 15 An exemplary structural diagram of a virtual scene construction apparatus provided in an embodiment of this application is shown.

[0037] Figure 16 This illustration shows an exemplary structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0038] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.

[0039] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this application should have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms "first," "second," and similar terms used in the embodiments of this application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are only used to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0040] As described in the background section, a virtual scene is a virtual space where players experience games. Game developers pre-create game scenes during the development phase, and when players actually play the game, the pre-created scene is loaded for them to experience.

[0041] In related technologies, virtual scenes are usually created as a whole, such as editing the entire scene screen by screen, and developers need to manually select and edit the paths for players to walk on based on the entire scene.

[0042] The inventors' research revealed that in creating ultra-large virtual scenes, such as a scene measuring 1000x1000 meters, the entire scene could only be captured by a virtual camera positioned at an altitude of 3000 meters. Editing such massive virtual scenes requires loading the entire scene, zooming in on portions, and editing screen-by-screen, sometimes leading to severe engine lag due to excessive resource loading. This method of scene editing is resource- and time-intensive, and can only be performed by a single person in a single thread. Furthermore, the engine files can only be maintained by a single game developer, making virtual scene creation extremely costly and time-consuming.

[0043] Furthermore, ultra-large scenes often have various bugs that are difficult to test. Setting up the hidden surface model is a huge undertaking and is very easy to make mistakes in operation. Once a vulnerability appears in a certain area of ​​the virtual scene, it is difficult to accurately find the specific location of the vulnerability.

[0044] Figure 1 A schematic diagram of the automated scene generation in related technologies is shown.

[0045] Through the inventor's research, it was discovered that in another related technology, reference... Figure 1 While Houdini (a 3D computer graphics software) can be used to automatically generate scenes, its stitching principle primarily relies on basic terrain undulations and connecting layers, with minimal landscape embellishment, resulting in a rather empty final scene. To achieve richer visual content, a significantly increased number of modular models are needed. Since most dungeon-type level routes are linear and the terrain is flat, automatically generated scenes tend to be rather rigid. The scene routes lack variation, thematic design is absent, and there's a lack of atmospheric change, failing to achieve the desired effect of changing scenery with each step.

[0046] Therefore, this application provides a virtual scene construction method, apparatus, electronic device, and storage medium that stitches together multiple scene module planar images based on pre-acquired unit pixel modules; performs a 3D transformation operation on the scene module planar images based on scene information in the planar images to construct multiple scene modules corresponding to the multiple scene module planar images; wherein each scene module includes at least: a path; determining path information corresponding to the path in each scene module; and acquiring scene requirement parameters, and stitching together the scene modules corresponding to the path information based on the scene requirement parameters to construct a target virtual scene. This application obtains scene module planar images by stitching together unit pixel modules, which allows for rapid changes to the scene design in the scene module planar images compared to changing the scene design in a 3D scene. Furthermore, by dividing the target virtual scene into multiple scene modules for separate editing, not only is the editing cost reduced, but multiple developers can also edit each scene module separately, thus shortening the editing cycle to a certain extent. Furthermore, by splicing different scene modules together, a complete target virtual scene can be obtained. Since the scene modules that can be spliced ​​together can be freely selected during the splicing process, the generation effect of the entire target virtual scene is more diversified. Different target virtual scenes can be spliced ​​together from multiple different scene modules in the same group, making the virtual scene richer and more diverse.

[0047] Figure 2 This illustration shows an exemplary application scenario diagram of a virtual scene construction method provided in an embodiment of this application.

[0048] refer to Figure 2 In this application scenario, there are local terminal device 101 and server 102. The local terminal device 101 and server 102 can be connected via wired or wireless communication networks to achieve data interaction.

[0049] The local terminal device 101 can be an electronic device located close to the user side, possessing data transmission and multimedia input / output functions, such as a desktop computer, mobile phone, portable computer, tablet computer, media player, in-vehicle computer, smart wearable device, personal digital assistant (PDA), or other electronic devices capable of performing the aforementioned functions. This electronic device may include a processor and a display screen with touch input functionality. The display screen is used to present a graphical user interface (GUI), which can display a music game interface. The processor is used to process music game data, generate the GUI, and control the display of the GUI on the screen.

[0050] Server 102 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0051] In some exemplary embodiments, the virtual scene construction method may run on a local terminal device 101 or a server 102.

[0052] When the virtual scene construction method runs on server 102, server 102 provides virtual scene construction services to users on terminal devices. The terminal devices have a client installed that communicates with server 102, and users can specify a target program through the client. Server 102 obtains multiple scene module planar images by stitching together pre-acquired unit pixel modules; it then performs a 3D transformation operation on the scene module planar images based on scene information in these planar images to construct multiple scene modules corresponding to the multiple scene module planar images. Each scene module includes at least: a path; determining the path information corresponding to the path in each scene module; and obtaining scene requirement parameters, and stitching together the scene modules corresponding to the path information according to the scene requirement parameters to construct the target virtual scene. Server 102 can also send the target virtual scene to the client, and the client displays the target virtual scene to the user. The terminal device can be the aforementioned local terminal device 101.

[0053] When the virtual scene construction method runs on server 102, the method can be implemented and executed based on the cloud interaction system.

[0054] The cloud interaction system includes client devices and cloud gaming servers.

[0055] In some exemplary embodiments, various cloud applications, such as cloud gaming, can run under the cloud interaction system. Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operation mode, the main body running the game program and the main body displaying the game screen are separated. The storage and operation of the control methods for movement in the game are completed on the cloud gaming server. The role of the client device is to receive and send data and display the game screen. For example, the client device can be a display device with data transmission capabilities close to the user, such as a mobile terminal, television, computer, or PDA; however, the information processing is performed by the cloud gaming server in the cloud. When playing the game, the player operates the client device to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses the game screen and other data, returns it to the client device through the network, and finally, the client device decodes and outputs the game screen.

[0056] In the above embodiments, the virtual scene construction method is described using server 102 as an example. However, this disclosure is not limited thereto. In some exemplary embodiments, the virtual scene construction method can also be run on local terminal device 101.

[0057] The local terminal device 101 may include a display screen and a processor. A client is installed on the local terminal device 101, and a user can specify a target program through the client. The processor stitches together multiple scene module planar images based on pre-acquired unit pixel modules; it performs a 3D transformation operation on the scene module planar images based on scene information in the planar images to construct multiple scene modules corresponding to the multiple scene module planar images; wherein each scene module includes at least: a path; determining path information corresponding to the path in each scene module; and acquiring scene requirement parameters, and stitching together the scene modules corresponding to the path information based on the scene requirement parameters to construct a target virtual scene. The processor can also send the target virtual scene to the client, and the client displays the target virtual scene to the user through the display screen.

[0058] In some exemplary embodiments, taking a game as an example, the local terminal device 101 stores a game program and is used to display game visuals. The local terminal device 101 is used to interact with the player through a graphical user interface (GUI), i.e., conventionally downloading, installing, and running the game program via an electronic device. The local terminal device 101 can provide the GUI to the player in various ways, such as rendering it on a terminal's display screen or providing it to the player via holographic projection. For example, the local terminal device 101 may include a display screen for displaying the GUI, which includes game visuals, and a processor for running the game, generating the GUI, and controlling the display of the GUI on the display screen.

[0059] In some exemplary embodiments, this disclosure provides a method for constructing a virtual scene, which provides a graphical user interface through a terminal device. The terminal device may be the aforementioned local terminal device 101 or a client device in the aforementioned cloud interaction system.

[0060] The following is combined Figure 2 The above application scenarios are used to describe the virtual scene construction method according to exemplary embodiments of this disclosure. It should be noted that the above application scenarios are shown only to facilitate understanding of the spirit and principles of this disclosure, and the embodiments of this disclosure are not limited in any way. Rather, the embodiments of this disclosure can be applied to any applicable scenario.

[0061] Figure 3 An exemplary flowchart of a virtual scene construction method provided in an embodiment of this application is shown.

[0062] refer to Figure 3 The virtual scene construction method provided in this application embodiment specifically includes the following steps:

[0063] S302: Multiple scene module planar images are obtained by stitching together the pre-acquired unit pixel modules.

[0064] S304: Perform a 3D transformation operation on the scene module planar diagram based on the scene information in the scene module planar diagram to construct multiple scene modules corresponding to the multiple scene module planar diagrams; wherein, each scene module includes at least: a path.

[0065] S306: Determine the path information corresponding to the path in each scene module.

[0066] S308: Obtain scene requirement parameters, and splice the scene modules corresponding to the path information according to the scene requirement parameters to construct the target virtual scene.

[0067] When creating virtual game scenes, such as massive dungeon scenes, the first step is to set the scene's worldview, story prototype, main character biographies, environment, time period, map area, and other special requirements. Then, the specific construction of the virtual game scene begins. One of the key aspects of this application is dividing the massive virtual scene into multiple modules and using a "puzzle" approach to piece together these modules to create a complete virtual scene. This is obviously more time-saving and labor-efficient, and the piecing methods are not unique, thus enriching the overall construction effect of the virtual scene. For example, with three modules A, B, and C, provided the piecing requirements and rules are met, they can be pieced into a "straight line" shape, such as ABC, or into BAC. Of course, they can also be pieced into other shapes such as an "L" shape. This is the benefit of the modular piecing process.

[0068] Figure 4 An exemplary schematic diagram of a unit pixel module according to an embodiment of this application is shown.

[0069] In some embodiments, the types of areas that may appear in the scene can be determined based on the world view, story prototype, main character biographies, environment, time period, map area, and some special needs. These can be customized by the planners or game developers. Specifically, we can obtain, for example, Figure 4 The unit pixel module can include multiple areas distinguished by different colors, such as different types of areas like the spawn area, connecting passage, danger area, escape area, rich resource area, concealed area, and contested area. The unit pixel module can be set as a 50x50 square module for easy splicing.

[0070] Furthermore, a virtual scene typically includes path areas for players to walk through, and non-path areas for placing environmental elements such as buildings, vegetation, and lakes. Therefore, the unit pixel module can include both first-type and second-type pixels. The first-type pixels can be, for example... Figure 4 The multiple unit pixel modules shown in the first row are used to represent path regions, while for example... Figure 4 The multiple unit pixel modules shown in the second row, used to represent non-path regions, can be classified as second-type pixels. Setting both in the same planar graph yields the multiple unit pixel modules shown in the third row, meaning that both path and non-path regions appear simultaneously in the planar graph.

[0071] Specifically, based on pre-obtained stitching requirement information, the path area, path position, non-path area, and non-path position in multiple scene module planar diagrams can be determined. Then, first-type pixels can be stitched at the path positions in multiple initial planar diagrams of preset sizes to obtain path regions corresponding to the path areas. Further, second-type pixels are stitched at the non-path positions in the multiple initial planar diagrams to obtain non-path regions corresponding to the non-path areas. Multiple scene module planar diagrams are then determined based on the path regions and non-path regions.

[0072] The stitching requirement information can be used to indicate the path area, path location, non-path area, and non-path location. For example, it can be a planar image, which can be stitched together as follows: Figure 4 The various modules in the image are stitched together. Modules corresponding to a path are stitched together to determine the path position, and the path area is determined based on the area of ​​the path-corresponding module. Modules not corresponding to the path are stitched together to determine the non-path position, and the non-path area is determined based on the area of ​​the non-path-corresponding module. This allows for further stitching of first-type pixels at the path positions in an initial planar image of a preset size, such as 1000x1000, to obtain the path region, and stitching of second-type pixels at the non-path positions to obtain the non-path region. Finally, a scene module planar image is obtained based on the path and non-path regions.

[0073] Figure 5 An exemplary schematic diagram of a scene module plan view according to an embodiment of this application is shown.

[0074] In other words, the stitching requirements can be used to characterize the required path regions and non-path regions in one or more scene module planar diagrams, thereby determining information such as path area, path location, non-path area, and non-path location in the scene module planar diagrams. Furthermore, in multiple initial planar diagrams of preset dimensions, for example in... Figure 5 In the initial 50x50 plan shown, the locations of "walkable areas," "stairs down," and "walkable areas one floor down" can be determined based on the path positions. Then, the first type of pixels are stitched to the path positions until a path region corresponding to the path area is obtained. Similarly, for non-path areas, the locations corresponding to the non-path areas can be determined based on the non-path positions, such as the locations of "blocked intersections" and "impassable areas." Then, the second type of pixels are stitched to the non-path positions until a non-path region corresponding to the non-path area is obtained. Furthermore, the scene module plan can be determined based on the path and non-path regions.

[0075] Figure 6 An exemplary schematic diagram of a refined scene module plan view according to an embodiment of this application is shown.

[0076] After obtaining the scene module floor plan, in order to enable game developers to more intuitively construct specific virtual scenes using the floor plan, artistic processing can be performed on it. For example, drawing software can be used to modify the floor plan without altering its form and layout. Figure 5 The scene module floor plan shown is subjected to graphic and artistic processing to obtain, for example... Figure 6 The detailed scene module plan shown.

[0077] In another implementation, a preset texture can be obtained in advance, and the preset texture can be used to apply, for example... Figure 5 The scene module plan view is shown. For example, a first preset texture image can be assigned to the path area to obtain a path plan view, and a second preset texture image can be assigned to the non-path area to obtain a non-path plan view. Furthermore, based on the path plan view and the non-path plan view, for example, [the following can be determined]. Figure 6 The detailed scene module plan shown.

[0078] Figure 7(a) shows an exemplary schematic diagram of a refined scene module plan view containing the same number of intersections according to an embodiment of the present application.

[0079] Figure 7(b) shows an exemplary schematic diagram of another refined scene module plan view containing the same number of intersections according to an embodiment of the present application.

[0080] Figure 7(c) shows an exemplary schematic diagram of a further refined scene module plan view containing the same number of intersections according to an embodiment of the present application.

[0081] When splicing scene modules constructed from multiple different scene module floor plans, one of the main factors to consider is the interface of the path area on the edge used for splicing, similar to the shape of the splicing position in a jigsaw puzzle, such as how a "convex" shape can be spliced ​​with a "concave" shape. In other words, if the intersection positions and number of path areas in the scene module floor plans are the same, different path directions and non-path area contents can be set within the scene module floor plans to obtain different scene module floor plans. This allows for faster and more convenient mass production of multiple scene module floor plans. Figures 7(a)-(c) show three scene module floor plans with different internal path directions and different non-path area contents, but with the same intersection positions and number.

[0082] After obtaining the scene module plan, it is necessary to obtain the scene modules used to stitch together the target virtual scene. An important step is to perform a 3D transformation operation on the scene module plan based on the scene information in the scene module plan to construct multiple scene modules corresponding to multiple scene module plan.

[0083] In some embodiments, the path planar map and the non-path planar map in each scene module planar map can be equally divided into multiple planar grids, and scene information corresponding to each planar grid can be determined. The scene information may include at least the RGB values ​​corresponding to the planar grid. Further, the height value of each planar grid at its corresponding position in the scene module can be determined based on the RGB values ​​of each planar grid. The RGB values ​​can be directly or inversely proportional to the height value. For example, the sum of the squares of the R, G, and B values ​​can be determined, and the square root of this sum can be taken to determine the height value. That is, there can be two different relationships between the RGB values ​​and the height value: one is that the larger the RGB value, the larger the height value, with an overall trend approximating a direct proportional relationship; the other is that the larger the RGB value, the smaller the height value, with an overall trend approximating an inverse proportional relationship. No specific limitation is made here.

[0084] Furthermore, based on the height value of each planar grid in the scene module's planar diagram at its corresponding position within the scene module, a 3D transformation operation can be performed on each planar grid in the scene module's planar diagram, thereby constructing multiple scene modules that contain paths corresponding to the path planar diagrams.

[0085] Specifically, a 100x100 scene module planar drawing can be divided into multiple 5x5 planar grids. This allows for more flexible representation of the artistic effects within the scene module planar drawing and also enables better control over the accuracy of the scene module planar drawing. After obtaining the scene module planar drawing, if we want to determine the scene module obtained after 3D conversion based on the information in the scene module planar drawing, we need to determine the height value of each position after 3D conversion to obtain a 3D scene module. Then, we can determine the height of the corresponding position in the scene module based on the RGB values ​​corresponding to the planar grid. For example, the RGB value of the planar grid can be directly proportional to the height value of the area corresponding to that planar grid in the scene module; that is, the larger the RGB value of the planar grid, the larger the height value of the area corresponding to that planar grid in the scene module. Conversely, the RGB value of the planar grid can also be inversely proportional to the height value of the area corresponding to that planar grid in the scene module; that is, the larger the RGB value of the planar grid, the smaller the height value of the area corresponding to that planar grid in the scene module.

[0086] Regardless of whether the RGB values ​​and height values ​​are directly or inversely proportional, the height value of each planar mesh in the scene module can be determined based on its RGB values ​​in the scene module's planar diagram. This allows the planar mesh to be 3D-ified in 3D software, thus constructing the scene module corresponding to the scene module's planar diagram. Of course, height can be limited; for example, the maximum height cannot exceed 20 units. These 20 units are defined by the bottom surface of the scene module along the vertical axis of the 3D coordinate system. For instance, the center point of the bottom surface of the scene module could be (0, 0, 0).

[0087] In some embodiments, an initial height value corresponding to the minimum RGB value can be set. For example, the initial height corresponding to the RGB value (0, 0, 0) can be 0 units. Further, the difference between the RGB value corresponding to each planar grid and the minimum RGB value can be determined. If the difference between the RGB value corresponding to the planar grid and the minimum RGB value reaches a preset multiple of the preset interval RGB value, for example, if the RGB value of one planar grid is (128, 128, 128), the preset interval RGB value is (64, 64, 64), and the preset multiple is 1, then the height value of the corresponding position of the grid in the scene module can be increased by a preset height value. That is, if the initial height value of the corresponding position is 0 in the plane, then the difference between the current RGB value corresponding to the planar grid and the minimum RGB value reaches twice the preset interval RGB value, then 2 preset height values ​​can be added. For example, if the preset height value is 5 units, then the actual height value of the corresponding position of the planar grid in the scene module changes from 0 to 10 units.

[0088] In other embodiments, an initial height value corresponding to the maximum RGB value can be set. For example, the initial height corresponding to the RGB value (256, 256, 256) can be 0 units. Further, the difference between the RGB value corresponding to each planar grid and the maximum RGB value can be determined. If the difference between the RGB value corresponding to the planar grid and the maximum RGB value reaches a preset multiple of the preset interval RGB value, for example, if the RGB value of one planar grid is (128, 128, 128), the preset interval RGB value is (64, 64, 64), and the preset multiple is 1, then the height value of the corresponding position of the grid in the scene module can be increased by a preset height value. That is, if the initial height value of the corresponding position is 0 in the plane, then the difference between the current RGB value corresponding to the planar grid and the maximum RGB value reaches twice the preset interval RGB value, then 2 preset height values ​​can be added. For example, if the preset height value is 5 units, then the actual height value of the corresponding position of the planar grid in the scene module changes from 0 to 10 units.

[0089] In some embodiments, the center position of the scene module planar diagram can be determined, and the corresponding positions of planar grids in the scene module that are more than a preset distance from the center position can be defined as boundaries. For example, if the overall scene module size is 1000x1000, then the position 500 units away from the center position is defined as a boundary. Further, the corresponding positions of planar grids in the path planar diagram in the scene module can be defined as paths, i.e., the planar grids in the path planar diagram correspond to paths. The RGB values ​​of the planar grids corresponding to the first region containing the path in the boundary are set to the first RGB value, and the RGB values ​​of the planar grids corresponding to the second region not containing the path in the boundary are set to the second RGB value. That is, the path region and the non-path region are represented using different RGB values, thereby distinguishing between them. Further, the first height value corresponding to the first region can be determined based on the first RGB value of the planar grid corresponding to the first region, and the second height value corresponding to the second region can be determined based on the second RGB value of the planar grid corresponding to the second region. Therefore, the height values ​​of the first region containing the path and the second region not containing the path can be directly determined based on the first RGB value and the second RGB value.

[0090] Figure 8 An exemplary schematic diagram of a white-box scene module according to an embodiment of this application is shown.

[0091] In some embodiments, for the 3D representation of scene module floor plans, white-box model blocks of unit volume can be placed sequentially at the corresponding positions of each planar grid in each scene module floor plan, based on the height value of each planar grid in the scene module at its corresponding position, to construct a white-box scene module. For example, refer to... Figure 8 In the middle, what is shown is with Figure 6 The white-box scene module corresponding to the scene module plan diagram shown.

[0092] The 3D transformation process involves converting a 2D plan view into a 3D model. For example, a white-box scene module is first created from the scene module plan view, and this white-box scene module is a 3D model. This can be achieved in 3D software using simple polygons and simple white-box model blocks (e.g., 5m, 10m, or 1m cubes). Then, in an engine (e.g., UE4 engine), the wall model blocks and ground polygons are arranged according to a route map to create a 3D route. The height is also standardized; for example, the wall height can be 5 meters or 10 meters. Walls can be joined vertically to create walls of different heights, which aligns with the theory of building floors.

[0093] Software used for 3D conversion operations includes, for example, 3D Maker, which can convert 2D images into 3D models, compatible with various image formats such as JPG, BMP, PNG, and GIF, and supports a variety of 3D effects, such as spheres, cylinders, and cones. Software like DepthmapX can also be used, which generates high-precision 3D models from input depth and texture images. DepthmapX supports various depth image input methods, including triangulation, laser scanning, and stereoscopic photography. Another example is Blender, which not only performs 3D modeling and animation but also supports converting 2D images into 3D models. Blender offers a variety of 3D conversion tools, allowing users to choose the appropriate tool based on their needs.

[0094] Figure 9 An exemplary schematic diagram of a virtual asset according to an embodiment of this application is shown.

[0095] Figure 10 An exemplary schematic diagram of a scene module according to an embodiment of this application is shown.

[0096] Furthermore, pre-acquired virtual assets can be bound to preset locations within the white-box scene module, for example... Figure 9 The various types of virtual assets shown are used to beautify white-box scene modules, in order to construct a result such as... Figure 10 The scene modules shown.

[0097] Furthermore, you can create lighting, pathfinding, and obstacles. Finally, you can use software such as Neox2's "Save Model Group" function to bundle all objects, lighting, pathfinding, and obstacles together to obtain a scene module that more closely matches the target virtual scene setting.

[0098] It's worth noting that the height values ​​of different regions within the 3D-enhanced scene modules can actually be marked on the scene module planar diagram. For example, a first height parameter representing the height value of a path region within the scene module can be read from the path planar diagram, and a second height parameter representing the height value of a non-path region within the scene module can be read from the non-path planar diagram. This means that the height value corresponding to each grid is pre-marked on both the path and non-path planar diagrams. Furthermore, the path planar diagram can be 3D-enhanced based on the first height parameter, and the non-path planar diagram can be 3D-enhanced based on the second height parameter, to construct multiple scene modules corresponding to multiple scene module planar diagrams. In addition, the 3D engine allows for the design of lighting, fog effects, torches, smoke, and varying heights, perfectly transforming a simple 2D level into a 3D environment.

[0099] Regardless of the method used to obtain the 3D scene module, certain rules must be followed to ensure its rationality. For example, it can be determined whether the angle between the plane containing the path and the bottom surface of the scene module exceeds a preset angle, such as 45°. If the angle exceeds the preset angle, the height value of the path can be adjusted so that the angle between the plane containing the path and the bottom surface of the scene module is less than or equal to the preset angle. The RGB values ​​of the corresponding planar grid in the scene module's planar diagram are then re-determined based on the adjusted height value. In other words, it can be determined whether the slope of the path in the scene module is too large. For example, the preset angle can be 45°. If the slope exceeds 45°, the scene module will look abrupt, and in actual application, players will feel that the virtual character moves unnaturally within the target virtual scene. Then, the height value of the path with a slope exceeding 45° is adjusted to make the path gentler until the slope is less than or equal to 45°. Correspondingly, in the scene module planar diagram, the RGB values ​​of the planar mesh corresponding to the path after the height value is adjusted need to be adjusted accordingly.

[0100] Figure 11 An exemplary schematic diagram of a stitched, refined scene module plan view according to an embodiment of this application is shown.

[0101] During subsequent stitching, for any scene module among multiple scene modules, the intersections connecting to paths in other scene modules can be determined based on the extension direction of the paths within that scene module. The intersection location information, number of intersections, intersection size, and intersection opening direction are then determined. Further, the path information corresponding to the paths within each scene module can be determined based on the intersection location information, number of intersections, intersection size, and intersection opening direction. For example, if a scene module includes 1 intersection on edge A, 2 intersections on edge B, 0 intersections on edge C, and 1 intersection on edge D, then the intersection location information can be represented as the different edges that include the intersections. The number of intersections is then 1, 2, 0, and 1 respectively. The intersection size can be determined based on the distance between the two sides of the intersection in the scene module, and the intersection opening direction is the direction corresponding to each edge, i.e., the orientation of the intersection. (Reference) Figure 11 As you can see, after all the scene modules are stitched together, the stitched scene is displayed as a planar diagram, and multiple interconnected paths can be obtained.

[0102] Figure 12 An exemplary schematic diagram of a stitched white-box scene module according to an embodiment of this application is shown.

[0103] Specifically, the required number of scene modules can be determined based on scene requirement parameters. For any scene module among multiple scene modules, other scene modules with the same number and size of intersections on any side of that scene module, and corresponding to the intersection location and opening direction of that scene module, can be spliced ​​together to obtain paths where the included angle between the two paths at the splicing position of the scene modules is within a preset angle range and they are interconnected. Furthermore, scene modules can be spliced ​​together to connect all paths within the scene modules, and the number of spliced ​​scene modules reaches the required number of scene modules to construct the target virtual scene. (Reference) Figure 12 The target virtual scene obtained by splicing is a white-box scene module before setting decorations, which is consistent with... Figure 11 The plan view corresponds to this, meaning that each path is interconnected.

[0104] In some embodiments, it can be determined whether there are candidate scene modules among other scene modules where the number of intersections on each side is greater than a preset number, and whether the number and size of intersections on the first side are the same as those on the second side of the scene module. If there are candidate scene modules among other scene modules where the number of intersections on each side is greater than a preset number, and whether the number and size of intersections on the first side are the same as those on the second side of the scene module, it is determined whether there is a target scene module among the candidate scene modules where the opening direction of the intersection on the first side is opposite to the opening direction of the intersection on the second side of the scene module, and the intersection position information on the first side overlaps with the intersection position on the second side of the scene module. If there is a target scene module among the candidate scene modules where the opening direction of the intersection on the first side is opposite to the opening direction of the intersection on the second side of the scene module, and the intersection position information on the first side overlaps with the intersection position on the second side of the scene module, then the second side of the scene module and the first side of the target scene module can be spliced ​​together to obtain a path connecting the scene modules.

[0105] For example, scene module 1 has an intersection M with a size of 10 facing a first direction (e.g., the left direction), and intersection M is located at the center of edge A, meaning that intersection M is equidistant from both ends of edge A. Scene module 2 has an intersection N with a size of 10 facing a second direction, and intersection N is located at the center of edge B, meaning that intersection N is equidistant from both ends of edge B, and the second direction is the opposite direction to the first direction, such as the right direction. Since the number and size of intersections in edge A of scene module 1 and edge B of scene module 2 are the same, and the positions and opening directions of intersections M and N are opposite, edge A of scene module 1 and edge B of scene module 2 can be spliced ​​together to obtain a path where the angle between the two paths at the splicing position of scene module 1 and scene module 2 is within a preset angle range and they are interconnected.

[0106] In other embodiments, if the number of intersections on the first side and the number of intersections on the second side are both zero, then the second side of the scene module is concatenated with the first side of any candidate scene module. That is, if two scene modules each have one side with a number of intersections of 0 (i.e., excluding intersections), then these two sides of the two scene modules can be concatenated.

[0107] If there is no candidate scene module in the candidate scene module whose first-side intersection opening direction is opposite to the second-side intersection opening direction in the scene module, and / or whose first-side intersection position information overlaps with the second-side intersection position in the scene module, then it is determined whether there is a candidate scene module in the candidate scene module whose first-side intersection opening direction, after transformation, is opposite to the second-side intersection opening direction in the scene module, and whose first-side intersection position information overlaps with the second-side intersection position in the scene module. The transformation operation includes at least a rotation operation around a central axis passing through the center point of the scene module and perpendicular to the bottom surface of the scene module. If there is a candidate scene module in the candidate scene module whose first-side intersection opening direction, after transformation, is opposite to the second-side intersection opening direction in the scene module, and whose first-side intersection position information overlaps with the second-side intersection position in the scene module, then the second side of the scene module and the first side of the target scene module are spliced ​​together to obtain a path connecting the scene modules.

[0108] For example, a scene module includes edges in four directions: top, bottom, left, and right. Scene module 1 has an intersection K on its top edge, with K located at the center of the top edge. Scene module 2 has an intersection L on its right edge, with L located at the center of the right edge. If scene module 2 is rotated 90° counterclockwise around its central axis (which passes through its center point and is perpendicular to its bottom surface), the orientation of intersection L will change from right to down. By then joining the edges corresponding to intersections K and L, scene module 1 and scene module 2 can be joined together.

[0109] In some embodiments, the path height may not be uniform within the same scene module; that is, the path in a scene module may have a slope. Of course, this slope must be less than or equal to a preset angle, such as 45°. Therefore, when two scene modules that meet the splicing conditions in the aforementioned embodiments are spliced, it is also necessary to consider whether the extension of the spliced ​​path meets certain requirements. Specifically, when the path at the intersection of two scene modules has a slope, the angles between the extension directions of the planes containing the paths at the intersections of the two adjacent modules and the ground must be complementary to ensure the smoothness and fluidity of the spliced ​​path.

[0110] It should be noted that if two scene modules have paths that need to be spliced, both of which have angles, such as both paths being uphill or both being downhill, then the spliced ​​path will be a V-shaped path or an inverted V-shaped path. As long as the slope is less than or equal to the preset angle, such as 45°, the path is considered to be able to be spliced.

[0111] In some embodiments, technicians may have specific requirements for stitching together the entire scene. For example, after stitching together several adjacent scene modules, a spacious room may be needed within the scene. In this case, it is necessary to ensure that the maximum width of the road within the corresponding module reaches a preset width, such as a minimum width of 15 and a maximum width of 90. Furthermore, the road area must meet a preset minimum area of ​​15x15 and a maximum area of ​​90x90.

[0112] Within the assembled scene, a module's usage rate can be determined by the number of intersections it has. More intersections mean higher reuse, while fewer intersections mean lower usage. The maximum number of intersections should not exceed 8, and the minimum should not be less than 1. Modules with fewer intersections are considered custom modules. Module weight is determined by usage rate; more intersections mean higher weight, and fewer intersections mean lower weight. General modules must all have 8 intersections, and a high proportion of general modules is necessary to enrich the scene's route representation. Simultaneously, a certain number of custom modules with fewer intersections are also required to make the routes more interesting.

[0113] After constructing the target virtual scene, it can be tested to ensure the rationality of its paths and prevent program vulnerabilities during official deployment. For example, pathfinding trajectories distributed along the paths in the target virtual scene can be generated. Furthermore, it can be determined whether there are at least two disconnected pathfinding trajectories. If at least two disconnected pathfinding trajectories exist, the scene module corresponding to the shorter pathfinding trajectory is replaced until there are no more than two disconnected pathfinding trajectories in the target virtual scene. This ensures that every path in the final target virtual scene is connected, and there are no disconnected paths that would render the path unusable.

[0114] Figure 13 An exemplary schematic diagram of a stitched portion of a target virtual scene according to an embodiment of this application is shown.

[0115] refer to Figure 13 As you can see, after the parts of the target virtual scene are pieced together and beautified and decorated, the paths presented are connected, and some paths within the target virtual scene have slopes, such as the steps which are presented at an uphill angle.

[0116] Figure 14 An exemplary schematic diagram of the user interface of the test software according to an embodiment of this application is shown.

[0117] The target virtual scene can also be tested using benchmarking software. Specifically, multiple colliders can be set on the pathfinding trajectory. These colliders can support movable virtual objects, allowing them to move in any direction along the pathfinding trajectory. Furthermore, movable test virtual characters can be created in the target virtual scene, and test tasks can be configured onto them, enabling them to move along the pathfinding trajectory according to the test tasks. When the test virtual character can traverse the pathfinding trajectory, movable virtual objects are created at the corresponding positions of the colliders based on pre-acquired virtual assets. In other words, referencing... Figure 14 Test tasks can be configured to test virtual characters, such as the character path corresponding to the pathfinding trajectory that the test virtual character will run, and corresponding actions can be configured for the character. During the test, the test process can be presented in real time using a display device. Therefore, scene window parameters and corresponding parameters of the virtual camera in the scene can be configured, such as rotation angle, tilt angle, and distance between the camera and the test virtual character.

[0118] Furthermore, virtual objects, such as interactive NPC characters, can be added to the target virtual scene to increase its playability. For example, the area of ​​the path corresponding to the pathfinding trajectory in a scene module can be determined, and then the distribution density of movable virtual objects created at the corresponding positions of colliders in each scene module can be determined based on the area of ​​the path corresponding to the pathfinding trajectory in the scene module. For example, when the area of ​​the corresponding path in some scene modules is large, movable virtual objects with a higher distribution density, such as NPCs, can be configured on that path. For example, this path could correspond to a market in the virtual scene, which should contain a larger number of NPCs.

[0119] As can be seen from the above, the virtual scene construction method, apparatus, electronic device, and storage medium provided in this application obtain multiple scene module planar images by stitching together pre-acquired unit pixel modules; perform 3D conversion operations on the scene module planar images based on scene information in the scene module planar images to construct multiple scene modules corresponding to the multiple scene module planar images; wherein, each scene module includes at least: a path; determining the path information corresponding to the path in each scene module; and obtaining scene requirement parameters, and stitching together the scene modules corresponding to the path information according to the scene requirement parameters to construct a target virtual scene. This application obtains scene module planar images by stitching together unit pixel modules, which allows for rapid changes to the scene design in the scene module planar images compared to changing the scene design in a 3D scene. Furthermore, by dividing the target virtual scene into multiple scene modules for separate editing, not only is the editing cost reduced, but multiple developers can also edit each scene module separately, thus shortening the editing cycle to a certain extent. Furthermore, by splicing different scene modules together, a complete target virtual scene can be obtained. Since the scene modules that can be spliced ​​together can be freely selected during the splicing process, the generation effect of the entire target virtual scene is more diversified. Different target virtual scenes can be spliced ​​together from multiple different scene modules in the same group, making the virtual scene richer and more diverse.

[0120] It should be noted that the method in this embodiment can be executed by a single device, such as a computer or server. The method can also be applied in a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method in this embodiment, and the multiple devices will interact with each other to complete the method described.

[0121] It should be noted that the above description describes some embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0122] Figure 15 An exemplary structural diagram of a virtual scene construction apparatus provided in an embodiment of this application is shown.

[0123] Based on the same inventive concept, corresponding to any of the above embodiments, this application also provides a virtual scene construction device.

[0124] refer to Figure 15 The virtual scene construction device includes: a stitching module, a 3D conversion module, a determination module, and a construction module; wherein,

[0125] The stitching module is configured to stitch together multiple scene module planar images based on pre-acquired unit pixel modules;

[0126] The 3D transformation module is configured to perform 3D transformation operations on the scene module planar diagram based on scene information in the scene module planar diagram to construct multiple scene modules corresponding to the multiple scene module planar diagrams; wherein, each scene module includes at least: a path;

[0127] The determination module is configured to determine the path information corresponding to the path in each scene module;

[0128] The construction module is configured to acquire scene requirement parameters and, based on the scene requirement parameters, splice together the scene modules corresponding to the path information to construct the target virtual scene.

[0129] In one possible implementation, the unit pixel module includes: a first type of pixel and a second type of pixel;

[0130] The splicing module is further configured as follows:

[0131] Based on the pre-obtained splicing requirement information, determine the path area, path position, non-path area, and non-path position in the multiple scene module planar diagrams;

[0132] The first type of pixels are spliced ​​together at the path positions in multiple initial planar diagrams of a preset size to obtain a path region corresponding to the path area;

[0133] The second type of pixels are spliced ​​together at the non-path locations in the multiple initial planar images to obtain a non-path region corresponding to the non-path area;

[0134] The plan view of the multiple scene modules is determined based on the path region and the non-path region.

[0135] In one possible implementation, the splicing module is further configured as follows:

[0136] The path area is assigned a path plan map based on a pre-acquired first preset texture map;

[0137] The non-path area is assigned a pre-acquired second preset texture to obtain a non-path planar map;

[0138] The multiple scene module floor plans are determined based on the path floor plan and the non-path floor plan.

[0139] In one possible implementation, the 3Dization module is further configured as follows:

[0140] The path planar map and the non-path planar map in each scene module planar map are equally divided into multiple planar grids, and the scene information corresponding to each planar grid is determined; wherein, the scene information includes at least: the RGB value corresponding to the planar grid;

[0141] The height value of each planar grid at its corresponding position in the scene module is determined based on the RGB value of each planar grid.

[0142] Based on the height value of each planar grid in the scene module planar diagram corresponding to its position in the scene module, a 3D conversion operation is performed on each planar grid in the scene module planar diagram to construct a plurality of scene modules containing paths corresponding to the path planar diagram.

[0143] In one possible implementation, the 3Dization module is further configured as follows:

[0144] Set the minimum RGB value to correspond to the initial height value, and determine the difference between the RGB value of each planar grid and the minimum RGB value;

[0145] In response to the difference between the RGB value corresponding to each planar grid and the minimum RGB value reaching a preset multiple of the preset interval RGB value, the height value of each planar grid at the corresponding position in the scene module is increased by a preset height value.

[0146] In one possible implementation, the 3Dization module is further configured as follows:

[0147] Set the initial height value corresponding to the maximum RGB value, and determine the difference between the RGB value of each planar grid and the maximum RGB value;

[0148] In response to the difference between the RGB value corresponding to each planar grid and the maximum RGB value reaching a preset multiple of the preset interval RGB value, the height value of each planar grid at the corresponding position in the scene module is increased by a preset height value.

[0149] In one possible implementation, the 3Dization module is further configured as follows:

[0150] Determine the center position of the scene module planar diagram, and define the corresponding positions of planar grids in the scene module that are more than a preset distance from the center position as boundaries;

[0151] The corresponding positions of the planar grids in the path planar diagram in the scene module are determined as paths;

[0152] Set the RGB value of the planar mesh corresponding to the first region in the boundary that contains the path to the first RGB value, and set the RGB value of the planar mesh corresponding to the second region in the boundary that does not contain the path to the second RGB value;

[0153] The first height value corresponding to the first region is determined based on the first RGB value of the planar grid corresponding to the first region, and the second height value corresponding to the second region is determined based on the second RGB value of the planar grid corresponding to the second region.

[0154] In one possible implementation, the 3Dization module is further configured as follows:

[0155] Based on the height value of each planar grid in the scene module planar diagram at the corresponding position in the scene module, white box model blocks of unit volume are placed sequentially at the corresponding positions of each planar grid in the scene module planar diagram to construct a white box scene module;

[0156] The pre-acquired virtual assets are bound to preset locations in the white-box scene module to construct the scene module.

[0157] In one possible implementation, the 3Dization module is further configured as follows:

[0158] Read a first height parameter representing the height value of the path region at the corresponding position in the scene module in the path plan diagram, and read a second height parameter representing the height value of the non-path region at the corresponding position in the scene module in the non-path plan diagram;

[0159] The path plan is 3D-ified based on the first height parameter, and the non-path plan is 3D-ified based on the second height parameter, to construct multiple scene modules corresponding to the multiple scene module plan maps.

[0160] In one possible implementation, the 3Dization module is further configured as follows:

[0161] Determine whether the angle between the plane containing the path and the bottom surface of the scene module exceeds a preset angle;

[0162] In response to the angle between the plane containing the path and the bottom surface of the scene module exceeding the preset angle, the height value corresponding to the path is adjusted so that the angle between the plane containing the path and the bottom surface of the scene module is less than or equal to the preset angle, and the RGB value of the planar grid corresponding to the path in the scene module planar diagram is re-determined according to the adjusted height value corresponding to the path.

[0163] In one possible implementation, the determining module is further configured as follows:

[0164] For any one of the plurality of scene modules.

[0165] Based on the extension direction of the path in the scene module, determine the intersection for connecting with the path in other scene modules, and determine the intersection location information, number of intersections, intersection size and intersection opening direction corresponding to the intersection;

[0166] The path information corresponding to the path in each scene module is determined based on the intersection location information, number of intersections, intersection size, and intersection opening direction of the intersection in each scene module.

[0167] In one possible implementation, the building module is further configured as follows:

[0168] The required quantity of the scenario modules is determined based on the scenario requirement parameters.

[0169] For any one of the plurality of scene modules.

[0170] Other scene modules that have the same number of intersections and intersection size as the scene module on any side, and whose intersection position information and intersection opening direction correspond to the scene module, are spliced ​​with the scene module to obtain paths where the included angle of the two paths at the splicing position between the scene modules is within a preset angle range and they are interconnected.

[0171] The various scene modules are spliced ​​together to connect all paths in the scene modules, and the number of spliced ​​scene modules reaches the required number of scene modules to construct the target virtual scene.

[0172] In one possible implementation, the building module is further configured as follows:

[0173] Among the other scene modules where the number of intersections on each side is greater than a preset number, there exists a candidate scene module whose number of intersections and intersection size on the first side are the same as those on the second side of the scene module.

[0174] In response to the existence of candidate scene modules among other scene modules where the number of intersections is greater than a preset number and the number of intersections on the first side and the intersection size are the same as the number of intersections on the second side of the scene module, it is determined whether there is a target scene module among the candidate scene modules where the opening direction of the intersection on the first side is opposite to the opening direction of the intersection on the second side of the scene module, and the intersection position information on the first side overlaps with the intersection position on the second side of the scene module;

[0175] In response to a target scene module in the candidate scene module where the opening direction of the intersection on the first side is opposite to the opening direction of the intersection on the second side of the scene module, and the intersection position information on the first side overlaps with the intersection position on the second side of the scene module, the second side of the scene module and the first side of the target scene module are spliced ​​together to obtain a path connecting the scene modules.

[0176] In one possible implementation, the building module is further configured as follows:

[0177] If the number of intersections on the first side and the number of intersections on the second side are both zero, then the second side of the scene module is concatenated with the first side of any candidate scene module to obtain a path connecting the scene modules.

[0178] In one possible implementation, the building module is further configured as follows:

[0179] In response to the absence of a target scene module in the candidate scene module where the opening direction of the first side of the intersection is opposite to the opening direction of the second side of the intersection in the scene module, and / or where the intersection position information of the first side overlaps with the intersection position of the second side of the scene module, it is determined whether there exists a target scene module in the candidate scene module where, after the transformation operation, the opening direction of the first side of the intersection is opposite to the opening direction of the second side of the intersection in the scene module, and the intersection position information of the first side overlaps with the intersection position of the second side of the scene module; wherein, the transformation operation includes at least: a rotation operation with a central axis passing through the center point of the scene module and perpendicular to the bottom surface of the scene module as the rotation axis;

[0180] In response to a target scene module in the candidate scene module where the direction of the intersection opening on the first side after the transformation operation is opposite to the direction of the intersection opening on the second side in the scene module, and the intersection position information on the first side overlaps with the intersection position on the second side in the scene module, the second side of the scene module and the first side of the target scene module are spliced ​​together to obtain a path connecting the scene modules.

[0181] In one possible implementation, the device further includes: a testing module;

[0182] The test module is configured as follows:

[0183] Generate a pathfinding trajectory distributed along the path in the target virtual scene;

[0184] Determine whether there are at least two mutually disconnected pathfinding trajectories;

[0185] In response to the existence of at least two disconnected pathfinding trajectories, the scene module corresponding to the shorter pathfinding trajectory is replaced until there are no more than two disconnected pathfinding trajectories in the target virtual scene.

[0186] In one possible implementation, the test module is further configured as follows:

[0187] Multiple colliders are set on the pathfinding trajectory; wherein, the colliders are used to carry movable virtual objects, so that the movable virtual objects can move in any direction on the pathfinding trajectory;

[0188] A movable test virtual character is created in the target virtual scene, and a test task is configured to the test virtual character so that the test virtual character moves along the extension direction of the pathfinding trajectory according to the test task;

[0189] In response to the test virtual character being able to traverse the pathfinding trajectory, the movable virtual object is created at the corresponding position of the collider based on the pre-acquired virtual assets.

[0190] In one possible implementation, the apparatus further includes: a creation module;

[0191] The creation module is configured as follows:

[0192] Determine the area of ​​the path corresponding to the pathfinding trajectory in the scene module;

[0193] Based on the area of ​​the path corresponding to the path in the scene module, the distribution density of the movable virtual objects created at the corresponding positions of the colliders in each scene module is determined.

[0194] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing this application, the functions of each module can be implemented in one or more software and / or hardware.

[0195] The apparatus described above is used to implement the corresponding virtual scene construction method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0196] Figure 16 This illustration shows an exemplary structural diagram of an electronic device provided in an embodiment of this application.

[0197] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also 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 executes the program to implement the virtual scene construction method described in any of the above embodiments. Figure 16 This embodiment illustrates a more specific hardware structure of an electronic device, which may include a processor 1610, a memory 1620, an input / output interface 1630, a communication interface 1640, and a bus 1650. The processor 1610, memory 1620, input / output interface 1630, and communication interface 1640 are interconnected internally via the bus 1650.

[0198] The processor 1610 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0199] The memory 1620 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1620 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1620 and is called and executed by the processor 1610.

[0200] The input / output interface 1630 is used to connect input / output modules to enable information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.

[0201] The communication interface 1640 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0202] Bus 1650 includes a pathway for transmitting information between various components of the device, such as processor 1610, memory 1620, input / output interface 1630, and communication interface 1640.

[0203] It should be noted that although the above-described device only shows the processor 1610, memory 1620, input / output interface 1630, communication interface 1640, and bus 1650, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.

[0204] The electronic devices described above are used to implement the corresponding virtual scene construction methods in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0205] The memory 1620 stores machine-readable instructions executable by the processor 1610. When the electronic device is running, the processor 1610 communicates with the memory 1620 via the bus 1630, causing the processor 1610 to execute the following instructions during operation:

[0206] Multiple scene module planar images are obtained by stitching together pre-acquired unit pixel modules;

[0207] The scene module planar diagram is transformed into a 3D model based on the scene information in the scene module planar diagram to construct multiple scene modules corresponding to the multiple scene module planar diagrams; wherein each scene module includes at least: a path;

[0208] Determine the path information corresponding to the path in each scene module; and,

[0209] Obtain scene requirement parameters, and then splice the scene modules corresponding to the path information according to the scene requirement parameters to construct the target virtual scene.

[0210] In one possible implementation, the unit pixel module includes: a first type of pixel and a second type of pixel;

[0211] The instructions executed by processor 1610, which involve stitching together multiple scene module planar images based on pre-acquired unit pixel modules, include:

[0212] Based on the pre-obtained splicing requirement information, determine the path area, path position, non-path area, and non-path position in the multiple scene module planar diagrams;

[0213] The first type of pixels are spliced ​​together at the path positions in multiple initial planar diagrams of a preset size to obtain a path region corresponding to the path area;

[0214] The second type of pixels are spliced ​​together at the non-path locations in the multiple initial planar images to obtain a non-path region corresponding to the non-path area;

[0215] The plan view of the multiple scene modules is determined based on the path region and the non-path region.

[0216] In one possible implementation, the instructions executed by processor 1610, wherein determining the plurality of scene module planar diagrams based on the path region and the non-path region, includes:

[0217] The path area is assigned a path plan map based on a pre-acquired first preset texture map;

[0218] The non-path area is assigned a pre-acquired second preset texture to obtain a non-path planar map;

[0219] The multiple scene module floor plans are determined based on the path floor plan and the non-path floor plan.

[0220] In one possible implementation, the instructions executed by the processor 1610, which include performing a 3D transformation operation on the scene module planar diagram based on scene information in the scene module planar diagram to construct multiple scene modules corresponding to the multiple scene module planar diagrams, include:

[0221] The path planar map and the non-path planar map in each scene module planar map are equally divided into multiple planar grids, and the scene information corresponding to each planar grid is determined; wherein, the scene information includes at least: the RGB value corresponding to the planar grid;

[0222] The height value of each planar grid at its corresponding position in the scene module is determined based on the RGB value of each planar grid.

[0223] Based on the height value of each planar grid in the scene module planar diagram corresponding to its position in the scene module, a 3D conversion operation is performed on each planar grid in the scene module planar diagram to construct a plurality of scene modules containing paths corresponding to the path planar diagram.

[0224] In one possible implementation, the instruction executed by processor 1610, which involves determining the height value of each planar grid at its corresponding position in the scene module based on the RGB value of each planar grid, includes:

[0225] Set the minimum RGB value to correspond to the initial height value, and determine the difference between the RGB value of each planar grid and the minimum RGB value;

[0226] In response to the difference between the RGB value corresponding to each planar grid and the minimum RGB value reaching a preset multiple of the preset interval RGB value, the height value of each planar grid at the corresponding position in the scene module is increased by a preset height value.

[0227] In one possible implementation, the instruction executed by processor 1610, which involves determining the height value of each planar grid at its corresponding position in the scene module based on the RGB value of each planar grid, includes:

[0228] Set the initial height value corresponding to the maximum RGB value, and determine the difference between the RGB value of each planar grid and the maximum RGB value;

[0229] In response to the difference between the RGB value corresponding to each planar grid and the maximum RGB value reaching a preset multiple of the preset interval RGB value, the height value of each planar grid at the corresponding position in the scene module is increased by a preset height value.

[0230] In one possible implementation, the instruction executed by processor 1610, which involves determining the height value of each planar grid at its corresponding position in the scene module based on the RGB value of each planar grid, includes:

[0231] Determine the center position of the scene module planar diagram, and define the corresponding positions of planar grids in the scene module that are more than a preset distance from the center position as boundaries;

[0232] The corresponding positions of the planar grids in the path planar diagram in the scene module are determined as paths;

[0233] Set the RGB value of the planar mesh corresponding to the first region in the boundary that contains the path to the first RGB value, and set the RGB value of the planar mesh corresponding to the second region in the boundary that does not contain the path to the second RGB value;

[0234] The first height value corresponding to the first region is determined based on the first RGB value of the planar grid corresponding to the first region, and the second height value corresponding to the second region is determined based on the second RGB value of the planar grid corresponding to the second region.

[0235] In one possible implementation, the instructions executed by the processor 1610, which include performing a 3D transformation operation on each planar grid in each scene module planar graph based on the height value of each planar grid at its corresponding position in the scene module, to construct a plurality of scene modules containing paths corresponding to the path planar graph, include:

[0236] Based on the height value of each planar grid in the scene module planar diagram at the corresponding position in the scene module, white box model blocks of unit volume are placed sequentially at the corresponding positions of each planar grid in the scene module planar diagram to construct a white box scene module;

[0237] The pre-acquired virtual assets are bound to preset locations in the white-box scene module to construct the scene module.

[0238] In one possible implementation, the instructions executed by the processor 1610, which include performing a 3D transformation operation on the scene module planar diagram based on scene information in the scene module planar diagram to construct multiple scene modules corresponding to the multiple scene module planar diagrams, include:

[0239] Read a first height parameter representing the height value of the path region at the corresponding position in the scene module in the path plan diagram, and read a second height parameter representing the height value of the non-path region at the corresponding position in the scene module in the non-path plan diagram;

[0240] The path plan is 3D-ified based on the first height parameter, and the non-path plan is 3D-ified based on the second height parameter, to construct multiple scene modules corresponding to the multiple scene module plan maps.

[0241] In one possible implementation, after the processor 1610 executes instructions to construct the scene modules containing multiple paths corresponding to the path plan map, it further includes:

[0242] Determine whether the angle between the plane containing the path and the bottom surface of the scene module exceeds a preset angle;

[0243] If the angle between the plane containing the path and the bottom surface of the scene module exceeds the preset angle, the height value corresponding to the path is adjusted so that the angle between the path and the bottom surface of the scene module is less than or equal to the preset angle, and the RGB value of the planar grid corresponding to the path in the scene module planar diagram is re-determined according to the adjusted height value corresponding to the path.

[0244] In one possible implementation, the instruction executed by processor 1610, which involves determining the path information corresponding to the path in each scene module, includes:

[0245] For any one of the plurality of scene modules.

[0246] Based on the extension direction of the path in the scene module, determine the intersection for connecting with the path in other scene modules, and determine the intersection location information, number of intersections, intersection size and intersection opening direction corresponding to the intersection;

[0247] The path information corresponding to the path in each scene module is determined based on the intersection location information, number of intersections, intersection size, and intersection opening direction of the intersection in each scene module.

[0248] In one possible implementation, the instructions executed by the processor 1610, which involve splicing together the scene modules corresponding to the intersection location information according to the scene requirement parameters to construct a target virtual scene, include:

[0249] The required quantity of the scenario modules is determined based on the scenario requirement parameters.

[0250] For any one of the plurality of scene modules.

[0251] Other scene modules that have the same number of intersections and intersection size as the scene module on any side, and whose intersection position information and intersection opening direction correspond to the scene module, are spliced ​​with the scene module to obtain paths where the included angle of the two paths at the splicing position between the scene modules is within a preset angle range and they are interconnected.

[0252] The various scene modules are spliced ​​together to connect all paths in the scene modules, and the number of spliced ​​scene modules reaches the required number of scene modules to construct the target virtual scene.

[0253] In one possible implementation, the instructions executed by the processor 1610, which include concatenating other scene modules that have the same number of intersections and intersection size as the scene module, and that correspond to the intersection position information and intersection opening direction of the scene module, with the scene module to obtain a path connecting the scene modules, include:

[0254] Determine whether there exists a candidate scene module among the other scene modules where the number of intersections on each side is greater than a preset number, and whether the number of intersections and the intersection size on the first side are the same as the number of intersections and the intersection size on the second side of the scene module.

[0255] In response to the existence of candidate scene modules among other scene modules where the number of intersections is greater than a preset number and the number of intersections on the first side and the intersection size are the same as the number of intersections on the second side of the scene module, it is determined whether there is a target scene module among the candidate scene modules where the opening direction of the intersection on the first side is opposite to the opening direction of the intersection on the second side of the scene module, and the intersection position information on the first side overlaps with the intersection position on the second side of the scene module;

[0256] In response to a target scene module in the candidate scene module where the opening direction of the intersection on the first side is opposite to the opening direction of the intersection on the second side of the scene module, and the intersection position information on the first side overlaps with the intersection position on the second side of the scene module, the second side of the scene module and the first side of the target scene module are spliced ​​together to obtain a path connecting the scene modules.

[0257] In one possible implementation, after the processor 1610 executes instructions that respond to the existence of candidate scene modules in other scene modules where the number of intersections is greater than a preset number and the intersection size is the same as the number of intersections and the intersection size on the second side of the scene module, the instructions further include:

[0258] If the number of intersections on the first side and the number of intersections on the second side are both zero, then the second side of the scene module is spliced ​​together with the first side of any candidate scene module.

[0259] In one possible implementation, after determining whether there exists a target scene module in the candidate scene module where the opening direction of the intersection on the first side is opposite to the opening direction of the intersection on the second side in the scene module, and the intersection position information on the first side overlaps with the intersection position on the second side in the scene module, the instructions executed by the processor 1610 further include:

[0260] In response to the absence of a target scene module in the candidate scene module where the opening direction of the first side of the intersection is opposite to the opening direction of the second side of the intersection in the scene module, and / or where the intersection position information of the first side overlaps with the intersection position of the second side of the scene module, it is determined whether there exists a target scene module in the candidate scene module where, after the transformation operation, the opening direction of the first side of the intersection is opposite to the opening direction of the second side of the intersection in the scene module, and the intersection position information of the first side overlaps with the intersection position of the second side of the scene module; wherein, the transformation operation includes at least: a rotation operation with a central axis passing through the center point of the scene module and perpendicular to the bottom surface of the scene module as the rotation axis;

[0261] In response to a target scene module in the candidate scene module where the direction of the intersection opening on the first side after the transformation operation is opposite to the direction of the intersection opening on the second side in the scene module, and the intersection position information on the first side overlaps with the intersection position on the second side in the scene module, the second side of the scene module and the first side of the target scene module are spliced ​​together to obtain a path connecting the scene modules.

[0262] In one possible implementation, after the processor 1610 executes the instructions to construct the target virtual scene by splicing the scene modules corresponding to the path information according to the scene requirement parameters, it further includes:

[0263] Generate a pathfinding trajectory distributed along the path in the target virtual scene;

[0264] Determine whether there are at least two mutually disconnected pathfinding trajectories;

[0265] In response to the existence of at least two disconnected pathfinding trajectories, the scene module corresponding to the shorter pathfinding trajectory is replaced until there are no more than two disconnected pathfinding trajectories in the target virtual scene.

[0266] In one possible implementation, the instructions executed by the processor 1610, after the step of "until there are no more than two disconnected pathfinding trajectories in the target virtual scene" further include:

[0267] Multiple colliders are set on the pathfinding trajectory; wherein, the colliders are used to carry movable virtual objects, so that the movable virtual objects can move in any direction on the pathfinding trajectory;

[0268] A movable test virtual character is created in the target virtual scene, and a test task is configured to the test virtual character so that the test virtual character moves along the extension direction of the pathfinding trajectory according to the test task;

[0269] In response to the test virtual character being able to traverse the pathfinding trajectory, the movable virtual object is created at the corresponding position of the collider based on the pre-acquired virtual assets.

[0270] In one possible implementation, the instructions executed by processor 1610, which include creating the movable virtual object at the corresponding position of the collider based on pre-acquired virtual assets, include:

[0271] Determine the area of ​​the path corresponding to the pathfinding trajectory in the scene module;

[0272] Based on the area of ​​the path corresponding to the path in the scene module, the distribution density of the movable virtual objects created at the corresponding positions of the colliders in each scene module is determined.

[0273] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides a non-transitory computer-readable storage medium that stores computer instructions for causing the computer to execute the virtual scene construction method as described in any of the above embodiments.

[0274] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. 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 technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0275] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the virtual scene construction method as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0276] Based on the same inventive concept, corresponding to the virtual scene construction method described in any of the above embodiments, this disclosure also provides a computer program product, which includes computer program instructions. In some embodiments, the computer program instructions can be executed by one or more processors of a computer to cause the computer and / or the processor to execute the virtual scene construction method. Corresponding to the execution entity for each step in each embodiment of the virtual scene construction method, the processor executing the corresponding step may belong to the corresponding execution entity.

[0277] The computer program products of the above embodiments are used to cause the computer and / or the processor to execute the virtual scene construction method as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0278] It is understood that before using the technical solutions of the various embodiments in this application, users will be informed of the type, scope of use, and usage scenarios of the personal information involved in an appropriate manner, and user authorization will be obtained.

[0279] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose, based on the prompt message, whether to provide personal information to the software or hardware such as electronic devices, applications, servers, or storage media performing the operations described in this application.

[0280] As an optional but not limited implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0281] It is understood that the above notification and user authorization process is merely illustrative and does not limit the implementation of this application. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this application.

[0282] Those skilled in the art will understand that embodiments of this application can be implemented as a system, method, or computer program product. Therefore, this application can be specifically implemented as entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, this application can also be implemented as a computer program product contained in one or more computer-readable media, which includes computer-readable program code.

[0283] Any combination of one or more computer-readable media may be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example,, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (not exhaustive) of a computer-readable storage medium may include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.

[0284] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0285] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0286] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network (including a local area network (LAN) or a wide area network (WAN)), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0287] It should be understood that each block of a flowchart and / or block diagram, as well as combinations of blocks in a 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, or other programmable data processing device to produce a machine that, when executed by a computer or other programmable data processing device, creates means for implementing the functions / operations specified in the blocks of the flowchart and / or block diagram.

[0288] These computer program instructions may also be stored in a computer-readable medium that enables a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable medium produce a product comprising an instruction apparatus that implements the functions / operations specified in the boxes of a flowchart and / or block diagram.

[0289] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, such that the instructions that execute on the computer or other programmable apparatus can provide a process for implementing the functions / operations specified in the boxes of a flowchart and / or block diagram.

[0290] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0291] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0292] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this application (including the claims) is limited to these examples; within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this application as described above, which are not provided in the details for the sake of brevity.

[0293] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this application, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this application, and this also takes into account the fact that the details of the implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this application will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuits) have been set forth to describe exemplary embodiments of this application, it will be apparent to those skilled in the art that the embodiments of this application can be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0294] Although this application has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.

[0295] The embodiments of this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of this application.

Claims

1. A method for constructing a virtual scene, characterized in that, The method includes: Multiple scene module planar images are obtained by stitching together pre-acquired unit pixel modules; the unit pixel modules are used to represent path regions and non-path regions in the scene module planar images; The scene module planar diagram is transformed into a 3D model based on the scene information in the scene module planar diagram to construct multiple scene modules corresponding to the multiple scene module planar diagrams; wherein each scene module includes at least: a path; Determine the path information corresponding to the path in each scene module; and, Obtain scene requirement parameters, and then splice the scene modules corresponding to the path information according to the scene requirement parameters to construct the target virtual scene.

2. The method according to claim 1, characterized in that, The unit pixel module includes: a first type of pixel and a second type of pixel; The process of stitching together multiple scene module planar images based on pre-acquired unit pixel modules includes: Based on the pre-obtained splicing requirement information, determine the path area, path position, non-path area, and non-path position in the multiple scene module planar diagrams; The first type of pixels are spliced ​​together at the path positions in multiple initial planar diagrams of a preset size to obtain a path region corresponding to the path area; The second type of pixels are spliced ​​together at the non-path locations in the multiple initial planar images to obtain a non-path region corresponding to the non-path area; The plan view of the multiple scene modules is determined based on the path region and the non-path region.

3. The method according to claim 2, characterized in that, The step of determining the planar diagram of the plurality of scene modules based on the path region and the non-path region includes: The path area is assigned a path plan map based on a pre-acquired first preset texture map; The non-path area is assigned a pre-acquired second preset texture to obtain a non-path planar map; The multiple scene module floor plans are determined based on the path floor plan and the non-path floor plan.

4. The method according to claim 3, characterized in that, The step of performing a 3D transformation operation on the scene module planar diagram based on scene information in the scene module planar diagram to construct multiple scene modules corresponding to the multiple scene module planar diagrams includes: The path planar map and the non-path planar map in each scene module planar map are equally divided into multiple planar grids, and the scene information corresponding to each planar grid is determined; wherein, the scene information includes at least: the RGB value corresponding to the planar grid; The height value of each planar grid at its corresponding position in the scene module is determined based on the RGB value of each planar grid. Based on the height value of each planar grid in the scene module planar diagram corresponding to its position in the scene module, a 3D conversion operation is performed on each planar grid in the scene module planar diagram to construct a plurality of scene modules containing paths corresponding to the path planar diagram.

5. The method according to claim 4, characterized in that, The step of determining the height value of each planar grid at its corresponding position in the scene module based on the RGB value of each planar grid includes: Set the minimum RGB value to correspond to the initial height value, and determine the difference between the RGB value of each planar grid and the minimum RGB value; In response to the difference between the RGB value corresponding to each planar grid and the minimum RGB value reaching a preset multiple of the preset interval RGB value, the height value of each planar grid at the corresponding position in the scene module is increased by a preset height value.

6. The method according to claim 4, characterized in that, The step of determining the height value of each planar grid at its corresponding position in the scene module based on the RGB value of each planar grid includes: Set the initial height value corresponding to the maximum RGB value, and determine the difference between the RGB value of each planar grid and the maximum RGB value; In response to the difference between the RGB value corresponding to each planar grid and the maximum RGB value reaching a preset multiple of the preset interval RGB value, the height value of each planar grid at the corresponding position in the scene module is increased by a preset height value.

7. The method according to claim 4, characterized in that, The step of determining the height value of each planar grid at its corresponding position in the scene module based on the RGB value of each planar grid includes: Determine the center position of the scene module planar diagram, and define the corresponding positions of planar grids in the scene module that are more than a preset distance from the center position as boundaries; The corresponding positions of the planar grids in the path planar diagram in the scene module are determined as paths; Set the RGB value of the planar mesh corresponding to the first region in the boundary that contains the path to the first RGB value, and set the RGB value of the planar mesh corresponding to the second region in the boundary that does not contain the path to the second RGB value; The first height value corresponding to the first region is determined based on the first RGB value of the planar mesh corresponding to the first region, and the second height value corresponding to the second region is determined based on the second RGB value of the planar mesh corresponding to the second region.

8. The method according to claim 4, characterized in that, The step of performing a 3D transformation operation on each planar grid in each scene module planar diagram based on the height value of each planar grid at its corresponding position in the scene module, to construct multiple scene modules containing paths corresponding to the path planar diagram, includes: Based on the height value of each planar grid in the scene module planar diagram at the corresponding position in the scene module, white box model blocks of unit volume are placed sequentially at the corresponding positions of each planar grid in the scene module planar diagram to construct a white box scene module; The pre-acquired virtual assets are bound to preset locations in the white-box scene module to construct the scene module.

9. The method according to claim 3, characterized in that, The step of performing a 3D transformation operation on the scene module planar diagram based on scene information in the scene module planar diagram to construct multiple scene modules corresponding to the multiple scene module planar diagrams includes: Read a first height parameter in the path planar diagram that represents the height value of the path region at the corresponding position in the scene module, and read a second height parameter in the non-path planar diagram that represents the height value of the non-path region at the corresponding position in the scene module; The path plan is 3D-ified based on the first height parameter, and the non-path plan is 3D-ified based on the second height parameter, to construct multiple scene modules corresponding to the multiple scene module plan maps.

10. The method according to claim 3, characterized in that, After constructing the scene modules containing multiple paths corresponding to the path plan map, the method further includes: Determine whether the angle between the plane containing the path and the bottom surface of the scene module exceeds a preset angle; In response to the angle between the plane containing the path and the bottom surface of the scene module exceeding the preset angle, the height value corresponding to the path is adjusted so that the angle between the plane containing the path and the bottom surface of the scene module is less than or equal to the preset angle, and the RGB value of the planar grid corresponding to the path in the scene module planar diagram is re-determined according to the adjusted height value corresponding to the path.

11. The method according to claim 1, characterized in that, Determining the path information corresponding to the path in each scene module includes: For any of the multiple scene modules, an intersection for connecting with paths in other scene modules is determined based on the extension direction of the path in the scene module, and the intersection location information, number of intersections, intersection size, and intersection opening direction are determined accordingly. The path information corresponding to the path in each scene module is determined based on the intersection location information, number of intersections, intersection size, and intersection opening direction of the intersection in each scene module.

12. The method according to claim 11, characterized in that, The step of splicing together the scene modules corresponding to the intersection location information according to the scene requirement parameters to construct the target virtual scene includes: The required quantity of the scenario modules is determined based on the scenario requirement parameters. For any of the multiple scene modules, other scene modules that have the same number of intersections and intersection size on any side of the scene module, and that correspond to the intersection position information and intersection opening direction of the scene module, are spliced ​​with the scene module to obtain paths where the included angle of the two paths at the splicing position between the scene modules is within a preset angle range and they are interconnected. The various scene modules are spliced ​​together to connect all paths in the scene modules, and the number of spliced ​​scene modules reaches the required number of scene modules to construct the target virtual scene.

13. The method according to claim 12, characterized in that, The step of splicing other scene modules that have the same number and size of intersections as the scene module, and whose intersection location and opening direction correspond to those of the scene module, with the scene module to obtain the paths connecting the scene modules includes: Determine whether there exists a candidate scene module among the other scene modules where the number of intersections on each side is greater than a preset number, and whether the number of intersections and the intersection size on the first side are the same as the number of intersections and the intersection size on the second side of the scene module. In response to the existence of candidate scene modules among other scene modules where the number of intersections is greater than a preset number and the number of intersections on the first side and the intersection size are the same as the number of intersections on the second side of the scene module, it is determined whether there is a target scene module among the candidate scene modules where the opening direction of the intersection on the first side is opposite to the opening direction of the intersection on the second side of the scene module, and the intersection position information on the first side overlaps with the intersection position on the second side of the scene module; In response to a target scene module in the candidate scene module where the opening direction of the intersection on the first side is opposite to the opening direction of the intersection on the second side of the scene module, and the intersection position information on the first side overlaps with the intersection position on the second side of the scene module, the second side of the scene module and the first side of the target scene module are spliced ​​together to obtain a path connecting the scene modules.

14. The method according to claim 13, characterized in that, After responding to the existence of candidate scene modules in other scene modules where the number of intersections is greater than a preset number and the intersection size is the same as the number of intersections and the intersection size on the second side of the scene module, the method further includes: If the number of intersections on the first side and the number of intersections on the second side are both zero, then the second side of the scene module is spliced ​​together with the first side of any candidate scene module.

15. The method according to claim 13, characterized in that, After determining whether there exists a target scene module in the candidate scene module where the opening direction of the intersection on the first side is opposite to the opening direction of the intersection on the second side in the scene module, and the intersection position information on the first side overlaps with the intersection position on the second side in the scene module, the method further includes: In response to the absence of a target scene module in the candidate scene module where the opening direction of the first side of the intersection is opposite to the opening direction of the second side of the intersection in the scene module, and / or where the intersection position information of the first side overlaps with the intersection position of the second side of the scene module, it is determined whether there exists a target scene module in the candidate scene module where, after the transformation operation, the opening direction of the first side of the intersection is opposite to the opening direction of the second side of the intersection in the scene module, and the intersection position information of the first side overlaps with the intersection position of the second side of the scene module; wherein, the transformation operation includes at least: a rotation operation with a central axis passing through the center point of the scene module and perpendicular to the bottom surface of the scene module as the rotation axis; In response to a target scene module in the candidate scene module where the direction of the intersection opening on the first side after the transformation operation is opposite to the direction of the intersection opening on the second side in the scene module, and the intersection position information on the first side overlaps with the intersection position on the second side in the scene module, the second side of the scene module and the first side of the target scene module are spliced ​​together to obtain a path connecting the scene modules.

16. The method according to claim 1, characterized in that, After constructing the target virtual scene by splicing the scene modules corresponding to the path information according to the scene requirement parameters, the method further includes: Generate a pathfinding trajectory distributed along the path in the target virtual scene; Determine whether there are at least two mutually disconnected pathfinding trajectories; In response to the existence of at least two disconnected pathfinding trajectories, the scene module corresponding to the shorter pathfinding trajectory is replaced until there are no more than two disconnected pathfinding trajectories in the target virtual scene.

17. The method according to claim 16, characterized in that, After the pathfinding trajectories no longer exist in the target virtual scene (at least two disconnected paths), the process further includes: Multiple colliders are set on the pathfinding trajectory; wherein, the colliders are used to carry movable virtual objects, so that the movable virtual objects can move in any direction on the pathfinding trajectory; A movable test virtual character is created in the target virtual scene, and a test task is configured to the test virtual character so that the test virtual character moves along the extension direction of the pathfinding trajectory according to the test task; In response to the test virtual character being able to traverse the pathfinding trajectory, the movable virtual object is created at the corresponding position of the collider based on the pre-acquired virtual assets.

18. The method according to claim 17, characterized in that, The step of creating the movable virtual object at the corresponding position of the collider based on the pre-acquired virtual assets includes: Determine the area of ​​the path corresponding to the pathfinding trajectory in the scene module; Based on the area of ​​the path corresponding to the path in the scene module, the distribution density of the movable virtual objects created at the corresponding positions of the colliders in each scene module is determined.

19. A virtual scene construction device, characterized in that, The device includes: The stitching module is configured to stitch together multiple scene module planar images based on pre-acquired unit pixel modules; the unit pixel modules are used to characterize path regions and non-path regions in the scene module planar images. The 3D transformation module is configured to perform 3D transformation operations on the scene module planar diagram based on scene information in the scene module planar diagram to construct multiple scene modules corresponding to the multiple scene module planar diagrams; wherein, each scene module includes at least: a path; The determination module is configured to determine the path information corresponding to the path in each scene module; The construction module is configured to acquire scene requirement parameters and, based on the scene requirement parameters, splice together the scene modules corresponding to the path information to construct the target virtual scene.

20. 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, it implements the method as described in any one of claims 1 to 18.

21. A computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to implement the method according to any one of claims 1 to 18.

Citation Information

Patent Citations

  • Gaze data restoration method and system

    CN110147770A

  • Game scene generation method, device, computer readable medium and electronic equipment

    CN111135574A