Interactive processing method, device, equipment and storage medium for virtual scenes
By generating directed graphs in a virtual scene and dynamically adjusting the virtual object sequence based on the output parameters, the problem of high cost of game level design and uncontrollable difficulty is solved, and the level is automatically generated and difficulty control is realized, which improves the game experience.
Patent Information
- Application Number
- CN202510024193.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-01-07
AI Technical Summary
In the prior art, game level design is large, time cost is high, and difficulty is uncontrollable, resulting in excessive gaming resources and poor gaming experience.
Directed graphs are generated based on multiple virtual vehicle attributes in the virtual scene, virtual object sequences are generated by ascending sequence sampling of the degree parameters, and level difficulty is dynamically adjusted to realize automatic generation and update of levels.
Improve the level generation efficiency, reduce manual design costs, ensure the solvability and difficulty balance of the level, provide a personalized gaming experience, and avoid difficulty fluctuations caused by updates.
Smart Images

Figure CN119633389B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for level interaction in a virtual scene. Background Art
[0002] Virtual vehicle dispatch games are common puzzle games where players need to move vehicles in a certain order and pick up all passengers. The game has multiple levels with varying degrees of difficulty.
[0003] In related technologies, a large number of game levels are manually designed by developers. This design is labor-intensive and time-consuming. Moreover, once players use props to change attributes, the difficulty of the pre-designed levels will change, which makes the difficulty of the game uncontrollable or even unsolvable. This will cause the program to fall into an infinite loop during runtime, thereby occupying a large amount of resources, easily causing game lag, and affecting the gaming experience.
[0004] The related art lacks a solution for automatically generating levels and controlling difficulty during the game. Summary of the Invention
[0005] The embodiments of the present application provide a method, apparatus, device, and storage medium for interactive processing of a virtual scene, which can realize the automatic generation and difficulty control of levels in the virtual scene to save game resources.
[0006] The technical solution of the embodiment of the present application is implemented as follows:
[0007] The present invention provides a method for interactive processing of a virtual scene, the method comprising:
[0008] generating a first directed graph based on the attributes of a plurality of virtual vehicles in the virtual scene, wherein the first directed graph includes nodes corresponding to the virtual vehicles, and directed edges between the nodes represent positional relationships between the virtual vehicles;
[0009] Determine an out-degree parameter of each virtual vehicle in the first directed graph, wherein the out-degree parameter represents the number of edges with the virtual vehicle as a node;
[0010] Sampling the plurality of virtual vehicles according to an ascending sequence of the out-degree parameters to obtain a plurality of first seats, and generating a first virtual object sequence based on the plurality of first seats, wherein one of the first seats is used to carry one of the virtual objects in the first virtual object sequence;
[0011] generating a first level based on the properties of the plurality of virtual vehicles and the first virtual object sequence, and loading the first level into the virtual scene;
[0012] In a case where the first virtual object sequence is modified, sampling a plurality of second seats from the plurality of virtual vehicles in the first directed graph according to an ascending sequence of the out-degree parameters, and generating a second virtual object sequence matching the plurality of second seats;
[0013] A second level is generated based on the properties of the multiple virtual vehicles and the second virtual object sequence, and the first level in the virtual scene is updated to the second level.
[0014] The embodiment of the present application provides an interactive processing device for a virtual scene, comprising:
[0015] A level generation module is configured to generate a first directed graph based on the properties of a plurality of virtual vehicles in a virtual scene, wherein the first directed graph includes nodes corresponding to the virtual vehicles, and directed edges between the nodes represent positional relationships between the virtual vehicles; determine an out-degree parameter for each virtual vehicle in the first directed graph, wherein the out-degree parameter represents the number of edges having the virtual vehicle as a node; sample the plurality of virtual vehicles in ascending order of the out-degree parameters to obtain a plurality of first seats; generate a first virtual object sequence based on the plurality of first seats, wherein one of the first seats is used to carry one of the virtual objects in the first virtual object sequence; generate a first level based on the properties of the plurality of virtual vehicles and the first virtual object sequence, and load the first level into the virtual scene;
[0016] A level update module is configured to, when the first virtual object sequence is modified, sample a plurality of second seats from the plurality of virtual vehicles in the first directed graph in ascending order of the out-degree parameters to generate a second virtual object sequence matching the plurality of second seats; generate a second level based on attributes of the plurality of virtual vehicles and the second virtual object sequence, and update the first level in the virtual scene to the second level.
[0017] An embodiment of the present application provides an electronic device, comprising:
[0018] a memory for storing computer-executable instructions or computer programs;
[0019] The processor is used to implement the interactive processing method of the virtual scene provided in the embodiment of the present application when executing the computer executable instructions or computer program stored in the memory.
[0020] An embodiment of the present application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the interactive processing method of a virtual scene provided by an embodiment of the present application when executed by a processor.
[0021] An embodiment of the present application provides a computer program product, including a computer program or computer-executable instructions. When the computer program or computer-executable instructions are executed by a processor, the interactive processing method of the virtual scene provided in the embodiment of the present application is implemented.
[0022] The embodiments of the present application have the following beneficial effects:
[0023] Based on the properties of multiple virtual vehicles in a virtual scene, a first directed graph is generated with the virtual vehicles as nodes according to the positional relationship between the virtual vehicles, and the positional relationship between the multiple virtual vehicles is intuitively represented in the form of a directed graph; by determining the out-degree parameter of each virtual vehicle in the first directed graph, and sampling the multiple virtual vehicles in an ascending sequence of the out-degree parameters, a plurality of first seats are obtained, a first virtual object sequence is generated based on the multiple first seats, and the virtual vehicle that can be moved preferentially is determined according to the ascending order of the out-degree parameters, and a diversified virtual object sequence is dynamically generated; based on the properties of the multiple virtual vehicles and the first virtual object sequence, a first level is generated, and the first level is loaded in the virtual scene. By combining the directed graph and the virtual object sequence, the positional relationship between the virtual vehicles in the directed graph is analyzed, and the virtual object sequence is dynamically adjusted to automatically generate the level, thereby improving the generated level. The efficiency is improved, and the time cost of manual design and layout is reduced; when the first virtual object sequence is modified, multiple second seats are sampled from multiple virtual vehicles in the first directed graph in ascending order of the out-degree parameter to generate a second virtual object sequence matching the multiple second seats. The second virtual object sequence is generated based on the seats in the first directed graph, and the solvability of the level is ensured by matching the virtual objects with the seats. The second virtual object sequence and the directed graph that affect the level generation are controlled through the same sampling method as the first level, and the difficulty of the level update is balanced by controlling the factors affecting the level generation; the second virtual object sequence is generated based on the attributes of the multiple virtual vehicles, and the first level in the virtual scene is updated to the second level. The difficulty of the updated second level is balanced, so as to provide a personalized gaming experience and avoid reducing user interest due to a large difference in the difficulty of the updated second level. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1A This is a first schematic diagram of an application mode of the interactive processing method for a virtual scene provided in an embodiment of the present application;
[0025] Figure 1B This is a second schematic diagram of an application mode of the interactive processing method for a virtual scene provided in an embodiment of the present application;
[0026] Figure 2A This is a first structural diagram of an electronic device provided in an embodiment of the present application;
[0027] Figure 2Bis a second structural diagram of an electronic device provided in an embodiment of the present application;
[0028] Figure 3A This is a first flow chart of the interactive processing method of a virtual scene provided in an embodiment of the present application;
[0029] Figure 3B This is a second flow chart of the interactive processing method for a virtual scene provided in an embodiment of the present application;
[0030] Figure 3C 3 is a schematic diagram of a third flow chart of the interactive processing method of a virtual scene provided in an embodiment of the present application;
[0031] Figure 3D This is a fourth flow chart of the interactive processing method for a virtual scene provided in an embodiment of the present application;
[0032] Figure 4 This is a fifth flow chart of the interactive processing method for a virtual scene provided in an embodiment of the present application;
[0033] Figure 5 Schematic diagram of a vehicle dispatching game provided in an embodiment of the present application;
[0034] Figure 6A This is a first schematic diagram of vehicle relationships provided in an embodiment of the present application;
[0035] Figure 6B This is a second schematic diagram of the vehicle relationship provided in an embodiment of the present application;
[0036] Figure 6C This is the third schematic diagram of the vehicle relationship provided in the embodiment of the present application.
[0037] It should be pointed out that the above-mentioned "first" and "second" are only used to distinguish different solutions, and do not represent the degree of distinction between the advantages and disadvantages of the solutions or the priority in the implementation process. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solutions and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0039] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0040] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0041] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0042] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0043] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0044] 1) BusOut: This is a puzzle game derived from the "Huarong Dao" style. Its core gameplay is similar to classic "Huarong Dao" or parking games, but with a new passenger transport mechanic. In a BusOut game, there's a parking lot and a passenger queue. The player's primary goal is to move all vehicles out of a crowded square by maneuvering them and then picking up all passengers according to specific rules.
[0045] 2) Directed Graph: A directed graph is a pair consisting of a node set (V) and an edge set (E), denoted as (G, (V, E)). The node set (V) is a finite set of elements, called vertices or nodes. The edge set (E) is a set of ordered pairs, where each ordered pair (u, v) represents a directed edge from node u to node v.
[0046] 3) Out-degree parameter: In a directed graph, the out-degree parameter of a node v refers to the number of edges starting from v.
[0047] 4) In-degree parameter: In a directed graph, the in-degree parameter of a node v refers to the number of edges that end at v.
[0048] 5) Queue: It is a linear data structure that follows the first-in-first-out principle, which means that the first element that enters the queue is the first element to be removed.
[0049] In related technologies, many game levels are manually designed by developers, and while this process allows for a certain degree of control over the game's difficulty, level design is labor-intensive and time-consuming, and level adjustments are difficult. Once players use items to change attributes, pre-designed solutions may become ineffective, causing the level's difficulty to change or become unsolvable. Related technologies are unable to dynamically adjust game levels, and the repeated calls to the server to process level data create a high load, which can easily cause game lag and compromise the gaming experience.
[0050] Embodiments of the present application provide a method for interactive processing of a virtual scene, an interactive processing device for a virtual scene, an electronic device, a computer-readable storage medium, and a computer program product, which can realize the automatic generation and difficulty control of levels in the virtual scene to save game resources.
[0051] The following describes exemplary applications of the electronic devices provided in the embodiments of the present application. The devices provided in the embodiments of the present application can be implemented as various types of terminals, such as laptops, tablet computers, desktop computers, set-top boxes, smartphones, smart speakers, smart watches, smart TVs, and in-vehicle terminals. They can also be implemented as servers. The following describes exemplary applications when the devices are implemented as terminals or servers.
[0052] See also Figure 1A , Figure 1A This is a first schematic diagram of an application mode of the interactive processing method for a virtual scene provided in an embodiment of the present application, for example, to implement a level processing application supporting a virtual scene. Figure 1A The server 200, network 300, terminal device 400 and database 500 are involved. The terminal device 400 is connected to the server 200 via the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.
[0053] In some embodiments, in the scenario of game level generation, the user can be the developer of the game, and in the scenario of game interactive operation, the user can be the player. The server 200 is a server for executing the interactive processing method of the virtual scene, the terminal device 400 is a terminal operated by the user, and the terminal device 400 is pre-configured with an application for displaying the virtual scene, and the database 500 stores relevant card information.
[0054] For example, the server 200 obtains level data information from the database 500, sends the level data information to the terminal device 400 via the network 300, and loads the level into the virtual scene on the terminal device 400. The user arranges virtual vehicles (such as cars, ships, etc.) in the virtual scene loaded on the terminal device 400, and the user controls the virtual vehicles to move according to the preset rules of the level to complete the level clearance goal. In the case where the user uses props on the terminal device 400 to modify the sequence of virtual objects in the virtual scene, the terminal device 400 sends a user request to modify the virtual object sequence to the server 200 via the network 300. In response to receiving the request to modify the virtual object sequence, the server 200 samples the seats in the virtual vehicle based on the out-degree parameter of each virtual vehicle in the first directed graph corresponding to the virtual vehicle attribute, generates a matching virtual object sequence, and generates a new level based on the newly generated virtual object sequence and the first directed graph. The newly generated level is sent to the terminal device 400 via the network 300 for loading. The user continues to perform the virtual vehicle arrangement operation in the new level displayed on the terminal device 400 to complete the clearance goal of the new level.
[0055] See also Figure 1B , Figure 1B This is a second schematic diagram of an application mode of the interactive processing method of a virtual scene provided in an embodiment of the present application; for example, Figure 1B The terminal device 400 is involved.
[0056] In some embodiments, in the scenario of game level generation, the user can be the developer of the game, and in the scenario of game interactive operation, the user can be the player. The terminal device 400 is the terminal operated by the user. The terminal device 400 is pre-configured with an application for displaying a virtual scene, and the terminal device 400 stores relevant card information.
[0057] For example, a level is loaded into a virtual scene on terminal device 400, and the user arranges virtual vehicles (e.g., cars, ships, etc.) in the virtual scene loaded on terminal device 400. The user controls the virtual vehicles to move according to the preset rules of the level to complete the level clearance goal. In the case where the user uses props on terminal device 400 to modify the sequence of virtual objects in the virtual scene, in response to receiving a request to modify the virtual object sequence, terminal device 400 samples the seats in the virtual vehicle based on the out-degree parameter of each virtual vehicle in the first directed graph corresponding to the virtual vehicle attributes, generates a matching virtual object sequence, generates a new level based on the newly generated virtual object sequence and the first directed graph, and loads it into terminal device 400. The user continues to perform virtual vehicle arrangement operations in the new level displayed on terminal device 400 to complete the level clearance goal of the new level.
[0058] See also Figure 2A , Figure 2A is a first structural diagram of an electronic device provided in an embodiment of the present application, Figure 2A The terminal device 400 shown includes: at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. The various components in the terminal device 400 are coupled together via a bus system 440. It is understood that the bus system 440 is used to achieve connection and communication between these components. In addition to including a data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 440 is not shown in FIG. Figure 2A Various buses are labeled as bus system 440 .
[0059] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0060] The user interface 430 includes one or more output devices 431 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0061] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.
[0062] The memory 450 includes volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.
[0063] In some embodiments, the memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplified below.
[0064] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, and driver layer, which are used to implement various basic services and process hardware-based tasks;
[0065] A network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include Bluetooth, Wi-Fi, and Universal Serial Bus (USB).
[0066] a presentation module 453 for enabling presentation of information via one or more output devices 431 (e.g., a display screen, a speaker, etc.) associated with the user interface 430 (e.g., a user interface for operating peripheral devices and displaying content and information);
[0067] The input processing module 454 is configured to detect one or more user inputs or interactions from one of the one or more input devices 432 and to translate the detected inputs or interactions.
[0068] In some embodiments, the apparatus provided in the embodiments of the present application may be implemented in software. Figure 2A The interactive processing device 455 of the virtual scene stored in the memory 450 is shown. It can be software in the form of a program or plug-in, and includes the following software modules: a level generation module 4551 and a level update module 4552. These modules are logical and can be arbitrarily combined or further split according to the functions implemented. Figure 2A For the sake of convenience, all the above modules are shown at once, but it should not be considered that the interactive processing 455 of the virtual scene excludes the implementation of only the level generation module 4551. The functions of each module will be explained below.
[0069] See also Figure 2B , Figure 2B is a second structural diagram of an electronic device provided in an embodiment of the present application, Figure 2B The server 200 shown includes: at least one processor 210, a memory 250 and at least one network interface 220. The various components in the server 200 are coupled together via a bus system 240. It is understood that the bus system 240 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 240 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 240 is not described in detail. Figure 2B Various buses are labeled as bus system 240 .
[0070] The processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0071] The memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, etc. The memory 250 may optionally include one or more storage devices that are physically remote from the processor 210.
[0072] The memory 250 includes volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 250 described in the embodiments of the present application is intended to include any suitable type of memory.
[0073] In some embodiments, the memory 250 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplified below.
[0074] Operating system 251, including system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, and driver layer, which are used to implement various basic services and process hardware-based tasks;
[0075] The network communication module 252 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 220. Exemplary network interfaces 220 include Bluetooth, Wireless LAN (WiFi), and Universal Serial Bus (USB).
[0076] In some embodiments, the apparatus provided in the embodiments of the present application may be implemented in software. Figure 2B The interactive processing device 255 of the virtual scene stored in the memory 250 is shown. It can be software in the form of a program or plug-in, and includes the following software modules: a level generation module 2551 and a level update module 2552. These modules are logical and can be arbitrarily combined or further split according to the functions implemented. Figure 2BFor the sake of convenience, all the above modules are shown at once, but this should not be considered as excluding the implementation of the level interaction device 255 in the virtual scene that only includes the level generation module 2551. The functions of each module will be explained below.
[0077] In some embodiments, the terminal or server can implement the processing method of the question-answer data provided by the embodiment of the present application by running various computer-executable instructions or computer programs. For example, computer-executable instructions can be commands, machine instructions or software instructions at the microprogram level. The computer program can be a native program or software module in the operating system; it can be a local (Native) application (APPlicat ion, APP), that is, a program that needs to be installed in the operating system to run; it can also be a small program that can be embedded in any APP, that is, a program that only needs to be downloaded to a browser environment to run. In short, the above-mentioned computer-executable instructions can be instructions in any form, and the above-mentioned computer program can be an application, module or plug-in in any form.
[0078] The level processing method of the virtual scene provided by the embodiment of the present application will be described in combination with the exemplary application and implementation of the terminal provided by the embodiment of the present application.
[0079] Next, the interactive processing method of the virtual scene provided by the embodiment of the present application is described. As mentioned above, the electronic device that implements the interactive processing method of the virtual scene of the embodiment of the present application can be Figure 1A Server 200 or Figure 1B Therefore, the execution subject of each step will not be repeatedly described below.
[0080] See also Figure 3A , Figure 3A This is a first flow chart of the interactive processing method of the virtual scene provided by the embodiment of the present application, which will be combined with Figure 3A The steps shown are explained.
[0081] In step 301 , a first directed graph is generated based on attributes of a plurality of virtual vehicles in a virtual scene.
[0082] Here, the first directed graph includes nodes corresponding to virtual vehicles, and the directed edges between the nodes represent the positional relationship between the virtual vehicles.
[0083] In some embodiments, the virtual scene can be a parking lot displayed in a human-computer interaction interface, wherein the parking lot has a plurality of parking spaces for parking a plurality of virtual vehicles to be loaded with virtual objects, and the virtual vehicles can be vehicles with multiple seats. Each virtual vehicle has different attributes, and the attributes may include at least one of the following: the color of the virtual vehicle, the positional relationship between virtual vehicles, the total number of seats, and the number of vacant seats. A directed graph is a binary tuple consisting of a node set and an edge set. The node set is a finite set of elements, and the edge set is a set of ordered pairs, each ordered pair (u, v) represents a directed edge from node u to node v. Each virtual vehicle is regarded as a node, and the positional relationship between virtual vehicle nodes is regarded as a directed edge, to construct a first directed graph corresponding to multiple virtual vehicles in the virtual scene. In the embodiment of the present application, a node is an abstract representation of a virtual vehicle in a directed graph, and is a unique data element used to represent a specific virtual vehicle in a directed graph. Each node has a set of attributes that define the function of the virtual vehicle in the virtual scene.
[0084] In some embodiments, step 301 can be implemented in the following manner: generating multiple nodes corresponding to multiple virtual vehicles respectively; generating directed edges between the nodes corresponding to the virtual vehicles based on the positional relationship between the virtual vehicles; removing duplicate directed edges in the positional relationship graph according to the transfer relationship of the directed edges, and obtaining the positional relationship graph after removal as the first directed graph.
[0085] For example, a positional relationship is a relationship formed by the relative positions and movement direction restrictions between virtual vehicles in a virtual scene, which is determined by the layout of the virtual vehicles in the virtual scene. A corresponding number of nodes are generated according to the number of virtual vehicles, with one node representing one virtual vehicle, and the number of nodes is the same as the number of virtual vehicles. Assuming that the virtual vehicle moves in a straight line, the positional relationship between the multiple virtual vehicles placed in the virtual scene includes an obstruction relationship, and directed edges are generated between the corresponding nodes based on the obstruction relationship. An obstruction relationship is a type of positional relationship that represents the movement of a virtual vehicle being obstructed by another vehicle. A directed edge connects the nodes corresponding to the two virtual vehicles, and the obstructed virtual vehicle needs to move away from the other virtual vehicle before it can move. In the positional relationship, due to the mutual obstruction between virtual vehicles, the obstruction effect can be transmitted from one virtual vehicle to another virtual vehicle, so the directed edges between virtual vehicles have a transitive relationship. The transitive relationship can identify and remove duplicate directed edges implicitly represented by other directed edges.
[0086] In an embodiment of the present application, a virtual vehicle is a movable vehicle, and the front of the vehicle corresponds to the direction in which it can move. When placing the vehicles, there may be another vehicle in front of the front of a vehicle. At this time, the vehicle is blocked, and there is a blocking relationship between the two vehicles, generating a directed edge from the node corresponding to the blocked vehicle to the node corresponding to the blocking vehicle. For example: Node A corresponding to a virtual vehicle is blocked by Node B corresponding to another virtual vehicle. At this time, the virtual vehicle of Node A can only be moved after the virtual vehicle of Node B is removed. Then, a directed edge (a, b) is added between Node a and Node b corresponding to Virtual Vehicle A and Virtual Vehicle B respectively. The ordered pair (a, b) represents a directed edge from Node a to Node b. Since a virtual vehicle may be blocked by the positions of multiple other virtual vehicles at the same time, the blocking relationship is transmitted in sequence, so there is also a transmission relationship between the directed edges. A position relationship graph between virtual vehicles is constructed based on the nodes and directed edges of the virtual vehicles. The directed edges representing repeated blocking relationships in the position relationship graph are removed to obtain a simplified first directed graph. For example: node a is blocked by node b, and node b is blocked by node c. According to the transmission of the blocking relationship, node a is also blocked by node c. According to the construction rules of directed edges, there are directed edges (a, b), (b, c) and (a, c). At this time, the directed edge (a, c) can be implicitly represented by the directed edge (a, b) and the directed edge (b, c), and the directed edge (a, c) does not need to be reflected in the first directed graph.
[0087] In some embodiments, see Figure 6A , Figure 6A This is the first schematic diagram of the vehicle relationship provided by the embodiment of the present application; based on the positional relationship between the virtual vehicles in the virtual scene, a vehicle position relationship diagram is constructed. For example, there are four vehicles of different colors, and the positional relationship is shown in the vehicle position example 601. The number on each vehicle represents the number of passengers that the vehicle can currently carry (i.e., the number of free seats). When one of the vehicles is blocked by other vehicles, there is a directed edge between the two vehicle nodes. In the vehicle position example 601, the vehicle marked as 3 blocks the vehicle marked as 4, the vehicles marked as 3 and 10 both block the vehicle marked as 6, and the vehicle marked as 6 blocks the vehicle marked as 4. The vehicle position example 601 is converted into a vehicle directed graph example 6011 based on the blocking relationship.
[0088] In some embodiments, the blocking relationship between vehicles has a transitive property. When generating the first directed graph, directed edges with repeated blocking relationships can be removed. Figure 6B , Figure 6BThis is a second schematic diagram of vehicle relationships provided by an embodiment of the present application. The vehicle position example 602 shows four vehicles with a blocking relationship. The blocking relationship is converted into a vehicle directed graph example 6021, in which the virtual vehicle of node 3 is blocked by the virtual vehicles of nodes 4, 6, and 10, and the blocking relationship between nodes 4 and 10 is a repeated blocking relationship ( Figure 6B Only one blocking method is retained, and the repeated blocking relationship shown by the dotted line is removed to obtain the simplified first directed graph (i.e., vehicle directed graph example 6021).
[0089] In an embodiment of the present application, a first directed graph is generated based on the attributes of multiple virtual vehicles in a virtual scene, the virtual vehicles in the virtual scene are represented in the form of a directed graph, each virtual vehicle is regarded as a node with attributes, and the positional relationship between the nodes is represented by directed edges. Dynamic adjustment is achieved based on the attribute changes of the virtual vehicle in the form of a directed graph.
[0090] Continue to see Figure 3A In step 302, the out-degree parameter of each virtual vehicle in the first directed graph is determined.
[0091] Here, the out-degree parameter represents the number of edges with virtual vehicles as nodes.
[0092] In some embodiments, the nodes in the first directed graph are analyzed and the out-degree parameter of each virtual vehicle node is calculated. The out-degree of a node is the number of directed edges starting from each virtual vehicle node in the first directed graph.
[0093] For example: See Figure 6A , Figure 6A In the vehicle directed graph example 6011 shown in , there are four nodes. The number of directed edges starting from node 4 is 3, so the out-degree parameter of node 4 is 3. The number of directed edges starting from node 6 is 2, so the out-degree parameter of node 6 is 2. The number of directed edges starting from node 3 and node 10 is 0, so node 3 and node 10 are nodes with out-degree parameters of 0.
[0094] In some embodiments, step 302 can be implemented in the following manner: using the number of nodes of virtual vehicles in the first directed graph as the number of rows and columns, initializing a first out-degree matrix that conforms to the number of rows and columns, wherein the initial value of each element in the row where each node in the first out-degree matrix is located is zero; updating the element value of each element in the first out-degree matrix according to the nodes that constitute the directed edges in the first directed graph, wherein the element value of the directed edge starting from the node is set to a preset value; traversing the element values in the row corresponding to each node in the matrix after the update, and using the number of element values in the row as the preset value as the out-degree parameter of the node corresponding to each virtual vehicle.
[0095] For example, the number of nodes of virtual vehicles in the first directed graph is used as the number of rows and columns, and the first out-degree matrix that matches the number of rows and columns is initialized. The initial value of each element in the row where each node in the first out-degree matrix is located is set to zero. For example: Figure 6A In the directed graph shown, the first out-degree matrices of the four nodes in the vehicle directed graph example 6011 are initialized. The initialized first out-degree matrix is a four-by-four matrix, with each row and column arranged in the order of node 4, node 6, node 3, and node 10, and each element value in the matrix is zero. The directed edges in the first directed graph are traversed, and the element value of each element in the first out-degree matrix is updated based on the node information at both ends of the directed edge, and the element value of the node starting from the directed edge is set to 1. For example: there are three directed edges starting from node 4, namely, node 4 to node 6, node 4 to node 3 with a transfer attribute, and node 4 to node 10. At this time, the values of the elements corresponding to nodes 6, 3, and 10 in the row where node 4 is located are updated, and the element value of the row where node 4 is located is updated to [0, 1, 1, 1]. The number of directed edges starting from node 6 is 2, one from node 6 to node 3 and one from node 6 to node 10. The element value of the row where node 6 is located is updated to [0, 0, 1, 1]. The number of directed edges starting from nodes 3 and 10 is 0. The element values of the rows where nodes 3 and 10 are located after the update are still [0, 0, 0, 0]. The element values in the first out-degree matrix are updated according to all the directed edges in the first directed graph. The updated first out-degree matrix is traversed, and the number of element values of the corresponding rows in the matrix at each stage is calculated to be a preset value. The preset value is 1. The number of element values 1 is used as the out-degree parameter of the node, which represents the number of directed edges starting from the node. For example: in the row where node 4 is located, the number of element values with the preset value is 3, so the out-degree parameter of node 4 is 3.
[0096] In step 303 , multiple virtual vehicles are sampled according to an ascending sequence of out-degree parameters to obtain multiple first seats, and a first virtual object sequence is generated based on the multiple first seats.
[0097] Here, a first seat is used to carry a virtual object in a first virtual object sequence.
[0098] In some embodiments, in the first directed graph, nodes with smaller out-degree parameters indicate that their corresponding virtual vehicles are less likely to be blocked. During user interaction, virtual vehicles corresponding to nodes with smaller out-degree parameters are preferentially moved. Free seats in the virtual vehicle are sampled based on ascending order of out-degree parameters to obtain a plurality of first seats, each of which is used to carry a matching virtual object. The carried virtual objects are then arranged according to the plurality of first seats to generate a first virtual object sequence.
[0099] For example, see Figure 6A , Figure 6A The vehicle directed graph example 3011 in FIG. 3 shows a first directed graph consisting of four nodes, where the out-degree parameter of node 4 is 3, the out-degree parameter of node 6 is 2, and the out-degree parameters of nodes 3 and 10 are 0. Sorted in ascending order of the out-degree parameters, the node sampling order is node 3 and node 10, and node 6 and node 4. It is set that the number of all free seats sampled from the virtual vehicle of node 3 is 1, then the number of all free seats sampled from the virtual vehicle of node 10 is 2, then the number of all free seats sampled from the virtual vehicle of node 6 is 5, and finally the number of all free seats sampled from the virtual vehicle of node 4 is 4. At this time, the virtual objects carried by the free seats are arranged according to the sampling order to generate a first virtual object sequence. The number of virtual objects in the first virtual object sequence is 12, which is consistent with the number of sampled free seats.
[0100] In some embodiments, see Figure 3B , Figure 3B This is a second flow chart of the interactive processing method for a virtual scene provided in an embodiment of the present application; Figure 3A Step 303 in the above example can be performed by executing Figure 3B Steps 3031 to 3033 in are implemented as described below.
[0101] In step 3031, the out-degree parameter of each virtual vehicle is sorted in ascending order to obtain an ascending sequence of the out-degree parameters.
[0102] In some embodiments, the out-degree parameter of each virtual vehicle is calculated, and the out-degree parameters are arranged in ascending order to obtain an ascending sequence of the out-degree parameters.
[0103] In step 3032, the vacant seats in the virtual vehicle are sampled in ascending order to obtain a first preset number of first seats with an out-degree parameter of zero and a second preset number of first seats with an out-degree parameter not zero.
[0104] In some embodiments, vacant seats in virtual vehicles are sampled in ascending order. When the out-degree parameters of the nodes of two virtual vehicles are the same, the sampling order depends on the number of parking spaces in the virtual scene. Assuming that there are M parking spaces in the virtual scene for virtual vehicles to carry virtual objects, a first preset number of nodes with an out-degree parameter of zero and a second preset number of nodes with a non-zero out-degree parameter are randomly selected. The sum of the first preset number and the second preset number is the number of parking spaces M. The vacant seats in the virtual vehicles corresponding to the selected nodes are randomly sampled to obtain a first preset number of seats with an out-degree parameter of zero and a second preset number of seats with a non-zero out-degree parameter.
[0105] In step 3033, the virtual objects matching the first preset number of first seats with zero out-degree parameters and the second preset number of first seats with non-zero out-degree parameters are arranged according to a sampling order to obtain a first virtual object sequence.
[0106] In some embodiments, the attributes of a virtual vehicle include a maximum number of seats allowed to carry virtual objects, a number of available seats, and the color of the virtual vehicle. The number of virtual objects in a first virtual object sequence is the same as the number of first seats. Virtual objects matching a first preset number of first seats with zero out-degree parameters and a second preset number of first seats with non-zero out-degree parameters are arranged in sampling order. Virtual objects are considered matched if their color is the same as the color of the virtual vehicle to which the first seat belongs, thereby obtaining a first virtual object sequence.
[0107] In some embodiments, see Figure 5 , Figure 5 50 is a schematic diagram of a vehicle dispatching game provided in an embodiment of the present application; the game interface schematic diagram 501 shows that in a virtual scene (i.e., a parking lot), a passenger sequence 502 (i.e., a virtual object sequence) consisting of multiple passengers is queuing to get on the bus, and the passenger sequence information 5021 shows the current number of remaining passengers. A vehicle arrangement 503 consisting of multiple vehicles is arranged in the parking lot, and arrows are displayed on the vehicles in the vehicle arrangement 503. The direction indicated by the arrow represents the direction in which the corresponding vehicle can move. There is an obstruction relationship between the vehicles. The user can move the vehicle to the parking space in the available parking space 5031 according to the direction indicated by the arrow. When the attributes of the passenger and the vehicle are consistent, the vehicle can carry the corresponding number of passengers. The parking space displayed as "unlocked" is a parking space that is not available to the current player, that is, an unavailable parking space 5032, which can be changed to an available parking space when the player meets the unlocking conditions or uses props.
[0108] In the game interface, virtual vehicles have unique attributes, such as a 4-passenger car or a 6-passenger car. Each virtual object has a color attribute. A virtual vehicle can only carry virtual objects of the same color and leave the parking lot when it is fully loaded. Virtual vehicles can only move forward in a straight line and cannot turn. The movement of each vehicle is restricted by other vehicles. Passengers queue up, and if the passenger at the front of the line has not boarded, the virtual objects behind cannot board. Users need to move the vehicle in a certain order and pick up all virtual objects in the virtual object sequence.
[0109] In some embodiments, after step 303, the first directed graph is further modified in the following manner: based on the first virtual object sequence, the number of free seats for each virtual vehicle in the first directed graph is calculated; when the number of free seats is zero, the node of the virtual vehicle is removed from the first directed graph, and the attributes of the remaining virtual vehicles after the removal are updated; and the first directed graph is modified according to the attributes of the remaining virtual vehicles after the removal.
[0110] For example, in the process of generating a virtual object queue based on the first directed graph, the nodes in the first directed graph are updated according to the number of free seats in the virtual vehicles, and the number of free seats for each virtual vehicle is calculated according to the first virtual object sequence. When the number of free seats is zero, it indicates that the number of virtual objects carried by the virtual vehicle at this time has reached the maximum number allowed to be carried. At this time, the number of virtual objects on the virtual vehicle meets the maximum carrying number, and the virtual scene can be left. The node corresponding to the virtual vehicle that has left is removed from the first directed graph, and the first directed graph is modified according to the attributes of the remaining virtual vehicles after the removal, and the directed edge with the removed node as the starting point is removed from the first directed graph.
[0111] In the embodiment of the present application, a first virtual object sequence is generated based on the node out-degree parameters in a first directed graph generated by a virtual vehicle. During the generation of the virtual object sequence, the attributes of the nodes in the first directed graph are updated based on the idle time of the virtual vehicle. A matching virtual object sequence is automatically generated based on the attributes of the directed graph, thereby achieving dynamic generation and updating of levels. This improves the efficiency and accuracy of level generation, provides high adjustability and variability, and ensures that the levels are solvable. This enables dynamic generation of game levels, saves time and reduces errors caused by human factors.
[0112] Continue to see Figure 3A In step 304, a first level is generated based on the properties of the plurality of virtual vehicles and the first virtual object sequence, and the first level is loaded into the virtual scene.
[0113] In some embodiments, a first directed graph is generated based on the properties of multiple virtual vehicles, and a first virtual object sequence is generated using the out-degree parameters of the nodes in the first directed graph. A feasible solution exists between the first directed graph and the first virtual object sequence. Based on the feasible solution, the user removes all virtual vehicles and loads all virtual objects in the first virtual object sequence. A first level is generated based on the first directed graph and the first virtual object sequence, and the first level is loaded into the virtual scene based on the positional relationships and colors in the virtual object properties.
[0114] For example, a directed graph representing the positional relationships of virtual vehicles is constructed. All virtual objects are seated in the virtual vehicle's seats. At this point, the sequence of virtual objects waiting to be picked up in the parking space is empty, meaning there are no virtual objects waiting to board. A node in the directed graph is selected, and the virtual vehicle corresponding to the node is moved to the parking space. The virtual objects that have disembarked are then arranged in order at the parking space's waiting area until all virtual objects on the virtual vehicle have disembarked. At this point, the virtual vehicle leaves the parking space, leaving a vacant parking space. The virtual vehicle is then moved to a vacant parking space for the virtual objects to disembark. This process is repeated until all virtual vehicles have left the parking space, meaning all virtual pairs have disembarked. The first level generated using this approach must have a feasible solution, as the passenger queue generated by the virtual objects disembarking corresponds exactly to the process of vacant parking spaces being used to pick up virtual objects.
[0115] For example, different levels correspond to different grades. When a user enters the human-computer interaction interface, he or she first selects the level level he or she wants to interact with. In the virtual scene, a first level is selected for the user to load based on the level level selected by the user. The first level can be selected in any of the following ways: loading a first level that the user has not loaded, that is, selecting a first level that the user has not played before; loading an uncompleted first level, that is, selecting a first level that the user has played but not completed; randomly loading any level based on the level level, that is, selecting the first level completely randomly.
[0116] In step 305 , when the first virtual object sequence is modified, multiple second seats are sampled from multiple virtual vehicles in the first directed graph in ascending order of out-degree parameters to generate a second virtual object sequence matching the multiple second seats.
[0117] In some embodiments, the user is allowed to use props to change the color of the first virtual object sequence during interaction, providing the user with a clue to continue the interaction through the prop modification. If the color of the first virtual object sequence is modified, it is necessary to resample the available seats in multiple virtual vehicles in the first directed graph to obtain a new second virtual object sequence that matches the sampled available seats.
[0118] In some embodiments, step 305 can be implemented by: sampling the vacant seats in the virtual vehicle according to an ascending sequence of out-degree parameters to obtain a first preset number of second seats with an out-degree parameter of zero and a second preset number of second seats with an out-degree parameter of non-zero; sorting the virtual objects that match the first preset number of second seats with an out-degree parameter of zero and the second preset number of second seats with an out-degree parameter of non-zero according to the sampling order to obtain a second virtual object sequence that matches multiple second seats.
[0119] In some embodiments, the vacant seats in the virtual vehicle are sampled according to the ascending sequence of the out-degree parameter, and the vacant seats are seats in the virtual vehicle that do not carry objects. There are locations (i.e., parking spaces) in the virtual scene that allow the virtual vehicle to dock when carrying virtual objects. A first preset number and a second preset number are set according to the number of parking spaces, and the sum of the first preset number and the second preset number is the number of parking spaces. The smaller the node out-degree parameter, the higher the priority of the selection. According to the ascending sequence of the out-degree parameter, the first preset number of vacant seats is selected from the virtual vehicle with an out-degree parameter of zero, and the out-degree parameter of the node is updated according to the number of selected vacant seats. Then, the second preset number of vacant seats is selected from the virtual vehicle with an out-degree parameter that is not zero.
[0120] For example, free seats are sampled from the vertex with the highest priority (with an out-degree parameter of zero) and the number of remaining free seats is updated. The initial attributes of node a are (color, maximum number of seats allowed, number of free seats) = (yellow, 10, 10). Six free seats are extracted. After the extraction is completed, the attributes of node a are updated to (yellow, 10, 4). The six virtual objects whose colors are the same as the colors of the virtual vehicles to which the free seats belong are added to the second virtual object sequence. The above process of extracting virtual objects is repeated to obtain a second virtual object sequence that matches multiple second seats.
[0121] For example, the first preset number and the second preset number are the same as those used to construct the first virtual object sequence, so the generated second virtual object sequence has the same complexity as the first virtual object sequence. The complexity of the virtual object sequence is related to the process of randomly extracting vacant seats. The simpler the extraction process, the lower the complexity of the virtual object sequence. For example, two schemes are set: the first scheme extracts passengers by directly removing all people from the entire vehicle at once, leaving it empty; the second scheme is completely random and irregular. Under the same conditions, the level generated by the second scheme is more difficult than the first scheme because the virtual vehicle carrying virtual objects in the game process is less smooth under the second scheme. When the parking space is occupied, it takes longer to remove the virtual vehicle from the parking space, and the interaction difficulty increases.
[0122] In the embodiment of the present application, according to the first preset number and the second preset number that are the same as those used to generate the first virtual object sequence, when the color of the virtual object sequence is modified, the complexity of the regenerated second virtual object sequence remains consistent with the complexity of the first virtual object before modification, thereby realizing the control of the virtual object sequence generation parameters.
[0123] In step 306 , a second level is generated based on the properties of the multiple virtual vehicles and the second virtual object sequence, and the first level in the virtual scene is updated to the second level.
[0124] In some embodiments, a second directed graph is generated based on the attributes of multiple virtual vehicles, and a second virtual object sequence is generated using the out-degree parameters of the nodes in the second directed graph. A feasible solution exists between the second directed graph and the second virtual object sequence. Based on the feasible solution, the user removes all virtual vehicles and then loads all virtual objects in the second virtual object sequence. A second level is generated based on the second directed graph and the second virtual object sequence. Based on the positional relationships and colors of the virtual object attributes, the second level is loaded into the virtual scene, and the first level in the virtual scene is updated to the second level. The user then continues to remove the virtual vehicle based on the updated second level in the virtual scene.
[0125] In some embodiments, after step 304, see Figure 3C , Figure 3C is a third flow chart of the interactive processing method of the virtual scene provided by the embodiment of the present application; in the case where the attributes of the virtual vehicle and the first virtual object sequence are modified, by executing Figure 3C Steps 3041 to 3044 in the above process are used to update the first level, as described in detail below.
[0126] In step 3041, a second directed graph is generated based on the modified attributes of the virtual vehicle, and the out-degree parameter of each virtual vehicle in the second directed graph is determined.
[0127] In some embodiments, the user changes the color of the virtual vehicle and the color of the first virtual object sequence at the same time by using props. Based on the properties of the modified virtual vehicle, the modified virtual vehicle is used as a node, and the directed edges between the nodes are connected according to the positional relationship between the nodes to generate a second directed graph, and the out-degree parameter of the node of each virtual vehicle in the second directed graph is calculated.
[0128] In some embodiments, see Figure 3D , Figure 3D This is a fourth flow chart of the interactive processing method for a virtual scene provided in an embodiment of the present application; Figure 3C Step 3041 in the Figure 3D Steps 30411 to 3415 are implemented as described below.
[0129] In step 30411, the properties of the virtual vehicle before modification and the first virtual object sequence before modification are evaluated to determine the interaction parameters of the first level.
[0130] In some embodiments, the attributes of the virtual vehicle and the complexity of the virtual object sequence determine the interaction parameters of the current first level. The attributes of the virtual vehicle before modification and the first virtual object sequence before modification are evaluated by an evaluation model. The evaluation model may be a deep neural network. The attributes of the virtual vehicle before modification and the first virtual object sequence before modification are input into the deep neural network, and the model outputs predicted probabilities for the interaction parameters. The interaction parameters for different levels vary. The current level is classified based on the output predicted probabilities to determine the interaction parameters for the first level. For example, the interaction parameters for the first level may be set to include three dimensions: easy, medium, and difficult. When the output predicted probability is between 0 and 0.3, the interaction parameters for the first level are easy. When the output predicted probability is between 0.3 and 0.7, the interaction parameters for the first level are medium. When the output predicted probability is between 0.7 and 1, the interaction parameters for the first level are difficult.
[0131] In step 30412, the positional relationship between the virtual vehicles is modified according to the interaction parameters, and a second directed graph is generated according to the modified positional relationship between the virtual vehicles.
[0132] In some embodiments, different interaction parameters correspond to different virtual vehicle properties and the complexity of the virtual object sequence. After the prop modification is triggered, the relationship between the virtual vehicles is modified according to the interaction parameters of the first level, and the same number of blocks as the virtual vehicles before the modification is maintained. According to the blocking relationship between the modified virtual vehicle nodes, the directed edges between the modified nodes are connected to generate a second directed graph. The second directed graph is different from the first directed graph, and the number of blocks between the virtual vehicles in the second directed graph is the same as that in the first directed graph.
[0133] In step 30413, the second out-degree matrix that matches the number of rows and columns is initialized using the number of nodes of the virtual vehicles in the second directed graph as the number of rows and columns.
[0134] Here, the initial value of each element in the row where each node in the second out-degree matrix is located is zero.
[0135] In some embodiments, the nodes in the second directed graph are analyzed, and the out-degree parameter of each virtual vehicle node is calculated. The out-degree of a node is the number of directed edges in the second directed graph starting from each virtual vehicle node. A second out-degree matrix is initialized to match the number of rows and columns, with the number of virtual vehicle nodes in the second directed graph as the number of rows and columns. The initial value of each element in the row where each node in the second out-degree matrix is set to zero. The principle of initializing the second out-degree matrix is the same as that of step 302 above and will not be repeated here.
[0136] In step 30414, the element value of each element in the second out-degree matrix is updated according to the nodes constituting the directed edge in the second directed graph.
[0137] Here, the value of the element where there is a directed edge starting from the node is set to a preset value.
[0138] In some embodiments, in the embodiment of the present application, the preset value of the element value is 1, and the principle of updating the element value of each element in the second out-degree matrix is the same as the principle of the above step 302, which will not be repeated here.
[0139] In step 30415, the element values in the row corresponding to each updated node in the matrix are traversed, and the number of element values in the matrix row that is a preset value is used as the out-degree parameter of the node corresponding to each virtual vehicle.
[0140] In some embodiments, the principle of traversing the element values of the row corresponding to each node in the second out-degree matrix to determine the out-degree parameter corresponding to each node is the same as the principle of the above step 302 and is not repeated here.
[0141] In some embodiments, before executing step 3041, the second directed graph is also modified in the following manner: the path in the second directed graph is traversed; when a closed path is found and the closed path does not contain repeated directed edges and nodes, an exception prompt message is generated, wherein the exception prompt message is used to prompt that there is an error in the positional relationship between the virtual vehicles in the second directed graph; and the properties of the virtual vehicles with incorrect positional relationships in the second directed graph are modified.
[0142] In some embodiments, the second directed graph contains multiple paths composed of directed edges, each path containing at least three nodes. Each path is traversed starting from each node. When a closed path is found, the nodes that constitute the closed path all exist as both the starting and ending points in the closed path. At this point, the directed edges between the nodes form a loop, and the second directed graph has no solution. An exception prompt control can be triggered to generate an exception prompt message to notify the developer that there is an incorrect positional relationship between virtual vehicles in the second directed graph, resulting in the current second directed graph being unsolvable and requiring modification.
[0143] In some embodiments, see Figure 6C , Figure 6C This is the third schematic diagram of vehicle relationships provided by an embodiment of the present application. The four vehicles shown in vehicle position example 603 form a closed path. In this case, the corresponding vehicle directed graph example 6031 has no solution. In vehicle directed graph example 6031, if there is a path from a node along the directed edges back to the node itself, then the level is unsolvable. During level design, there is a probability that some of the vehicles in the level will form a loop. If a closed path is found, a prompt is triggered, and nodes in the loop are deleted or adjusted based on the closed path to avoid unsolvable levels.
[0144] In an embodiment of the present application, by detecting whether a closed path exists during the generation of the second directed graph, abnormal prompt information is generated in a timely manner to assist level developers in adjusting the positional relationship between virtual vehicles to ensure the solvability of the level.
[0145] Continue to see Figure 3C In step 3042, the modified virtual vehicle is sampled according to the ascending sequence of the out-degree parameter of each virtual vehicle in the second directed graph to obtain a plurality of third seats.
[0146] In some embodiments, the vacant seats in the modified virtual vehicle are sampled according to the ascending sequence of the out-degree parameters of each virtual vehicle in the second directed graph. Based on the same first and second preset numbers as used to construct the first virtual object sequence, the first preset number of vacant seats is preferentially selected from virtual vehicles with an out-degree parameter of zero, and the out-degree parameter of the node is updated based on the selected number of vacant seats. Then, the second preset number of vacant seats is selected from virtual vehicles with a non-zero out-degree parameter, and the first preset number of vacant seats is selected from virtual vehicles with a zero out-degree parameter, and the second preset number of vacant seats is selected from virtual vehicles with a non-zero out-degree parameter as the third seat.
[0147] In step 3043 , a third virtual object sequence matching the plurality of third seats is generated.
[0148] Here, the third virtual object sequence is different from the first virtual object sequence; in some embodiments, according to the order in which the vacant seats are selected, multiple virtual objects with the same color as the virtual vehicle to which the third seat belongs are arranged as the third virtual object sequence. In the process of generating the third virtual object sequence, the first preset number and the second preset number are the same as the parameters used in the process of generating the first virtual object sequence, and the complexity of the third virtual object sequence is the same as the complexity of the first virtual object.
[0149] In step 3044, a third level is generated based on the modified properties of the multiple virtual vehicles and the third virtual object sequence, and the first level is updated to the third level in the virtual scene.
[0150] In some embodiments, a second directed graph is generated based on the modified properties of multiple virtual vehicles, and a third level is generated based on the modified third virtual object sequence. There is a feasible solution between the second directed graph and the third virtual object sequence. According to the feasible solution, the user removes all virtual vehicles and carries all virtual objects in the third virtual object sequence. A feasible solution is any set of decision variable values that meets all constraints. In the embodiment of the present application, a feasible solution is that based on the given second directed graph and third virtual object sequence, there is a path or a group of paths that meet the clearance goal of the third level. Based on the positional relationship and color in the modified virtual object properties and the number and color order of the virtual objects in the third virtual object sequence, the third level is loaded in the virtual scene, and the first level in the virtual scene is updated to the third level. The user continues to perform the virtual vehicle removal operation according to the updated third level in the virtual scene.
[0151] In an embodiment of the present application, a first directed graph is generated based on the attributes of multiple virtual vehicles in a virtual scene. The virtual vehicles in the virtual scene are represented in the form of a directed graph, with each virtual vehicle being treated as a node with attributes. The positional relationship between nodes is represented by directed edges, intuitively displaying the blocking relationship between virtual vehicles. Dynamic design of virtual vehicles is achieved by adjusting the node attributes in the directed graph, saving time and design costs in level development. A first virtual object sequence is generated based on the node out-degree parameters in the first directed graph generated by the virtual vehicles. During the virtual object sequence generation process, the attributes of the nodes in the first directed graph are updated based on the availability of the virtual vehicles. Only the virtual vehicle attributes need to be edited, eliminating the need for extensive design of the virtual object sequence. This improves the speed and accuracy of level generation, provides high adjustability and variability, and ensures the existence of understanding. By combining the directed graph and sequence structure, dynamic generation of game levels is achieved, reducing errors caused by human factors, and efficiently generating diverse game levels based on different interaction parameters, thereby increasing player interest and game appeal. The interaction parameters for the level are determined based on the complexity of the virtual object sequence and the properties of the virtual vehicle. By controlling the generation parameters of the directed graph and virtual object sequence while maintaining the same interaction parameters and adding closed path detection to the directed graph generation process, we ensure that when users modify level properties using props, the difficulty of the regenerated level remains controllable while maintaining solvability. Level updates eliminate the need to repeatedly call the server to obtain data, reducing server load and computational complexity, avoiding server jitter that could affect gameplay smoothness, and ensuring a smoother player experience.
[0152] The following describes an exemplary application of the embodiments of the present application in a practical application scenario.
[0153] Vehicle Dispatch games are a type of puzzle game derived from the classic Huarong Pass. The core gameplay builds on the classic Huarong Pass with a new passenger transport mechanic. In a Vehicle Dispatch game, there's a parking lot and a line of passengers. The player's primary goal is to move all vehicles out of a crowded square by maneuvering them, and then pick up all the passengers according to specific rules. Players must move the vehicles in a specific order and pick up all the passengers. Sound planning and strategy are key to success. The game typically consists of multiple levels, each increasing in difficulty. As the levels progress, the number and layout of vehicles, as well as the color distribution and order of the passengers, become increasingly complex.
[0154] In related art, game levels and passenger sequences are manually designed. While this approach can achieve a certain degree of control, it is labor-intensive, time-consuming, and lacks adjustability. Once players use props to change the color of a vehicle or passenger, pre-designed solutions may become ineffective, causing the level difficulty to spiral out of control or become unsolvable, disrupting the player experience. Manually designed levels can lead to player fatigue after repeated play, reducing the game's appeal. Some games employ a simple method of randomly generating passenger sequences. While this approach can reduce design costs, it also makes level difficulty difficult to control, resulting in varying levels of quality. Players may face challenges that are either too simple or too complex, making them difficult to meet the needs of players of different skill levels. In extreme cases, unsolvable levels may result, making it impossible to ensure level solvability and the stability of the designed difficulty level, impacting the player's gaming experience and satisfaction. Related art has significant limitations in level design and dynamic adjustment capabilities.
[0155] The embodiment of the present application constructs a directed graph based on the blocking relationship of vehicle placement, preferentially identifies nodes with smaller out-degrees, and the nodes correspond to different vehicles. Each node has the color and passenger attributes of the vehicle. Priority is established according to the size of the node out-degree, and passengers are randomly selected from the node with the highest priority. The node attributes in the directed graph are updated in a timely manner. When the player uses props to change the vehicle color or passenger sequence, a certain number of passengers of the same color are added to the sequence in an orderly manner, the directed graph and the remaining passenger sequence are re-analyzed, and the vehicle color or passenger sequence is dynamically adjusted to ensure that the generated level always has a solution. During the level generation and adjustment process, an exception is prompted that there is an unsolvable situation, thereby realizing automatic generation and difficulty control of game levels and ensuring system stability.
[0156] The following is a description with reference to the accompanying drawings. Figure 4 , Figure 4 This is a fifth flow chart of the interactive processing method of the virtual scene provided in the embodiment of the present application. The execution subject can be a terminal device, a server or a combination of the two. Figure 1A As an example, the server in the example is used as the execution subject. Figure 4 The steps shown are explained in detail.
[0157] In step 401 , a vehicle relationship graph is constructed based on the vehicles and the positional relationships between the vehicles.
[0158] For example, in a vehicle scheduling game, multiple vehicles are placed in a virtual scene. The positional relationships between vehicles may be blocked. Each vehicle is abstracted as a node, and each node has attributes corresponding to the vehicle, including the vehicle's body color, the number of passengers allowed, and the number of passengers remaining. Based on the positional arrangement and blocking relationships of the vehicles, directed edges are constructed between the nodes. For example, if vehicle A is blocked by vehicle B, a directed edge (a, b) is added between nodes a and b corresponding to vehicles A and B, respectively. The ordered pair (a, b) represents a directed edge from node a to node b. Based on the directed edges constructed based on the vehicle nodes and blocking relationships, a vehicle relationship graph is constructed for the current virtual scene.
[0159] In some embodiments, see Figure 5 , Figure 5 This is a schematic diagram of a vehicle dispatching game provided in an embodiment of the present application. The game interface schematic diagram 501 shows a passenger sequence 502 consisting of multiple passengers waiting in line to get on the bus in a parking lot. Passenger sequence information 5021 shows the current number of remaining passengers. A vehicle array 503 consisting of multiple vehicles is arranged in the parking lot. Arrows are displayed on the vehicles in the vehicle array 503. The direction indicated by the arrow represents the direction in which the corresponding vehicle can move. There is an obstruction relationship between the vehicles. The player can move the vehicle to the parking space in the available parking space 5031 according to the direction indicated by the arrow. When the attributes of the passenger and vehicle are consistent, the vehicle can carry the corresponding number of passengers. The parking space displayed as "unlocked" is a parking space that is not available to the current player, that is, an unavailable parking space 5032. It can be changed to an available parking space when the player meets the unlocking conditions or uses props.
[0160] In the game interface, each car has a color attribute and a number of passengers (e.g., 4-passenger car, 6-passenger car), and each passenger has a color attribute. A car can only carry passengers of the same color and leave the parking lot when it is fully loaded. Cars can only move forward in a straight line and cannot turn. Each car's movement is restricted by other cars. Passengers line up, and if the passenger at the front of the line hasn't boarded, the passengers behind cannot board. In the virtual scene, there are places where passengers can board the car, called parking spaces. Players need to move the car in a certain order and pick up all the passengers.
[0161] In some embodiments, see Figure 6A , Figure 6AThis is the first schematic diagram of the vehicle relationship provided by the embodiment of the present application; based on the vehicles in the game scene and the blocking relationship between the vehicles, a vehicle position relationship diagram is constructed. For example, there are four vehicles of different colors, and the position relationship is shown in vehicle position example 601. The number on each vehicle represents the number of passengers that the vehicle can currently carry. When one of the vehicles is blocked by other vehicles, there is a directed edge between the two vehicle nodes. In vehicle position example 601, the vehicle marked as 3 blocks the vehicle marked as 4, the vehicles marked as 3 and 10 both block the vehicle marked as 6, and the vehicle marked as 6 blocks the vehicle marked as 4. Based on the blocking relationship, vehicle position example 601 is converted into a vehicle directed graph example 6011.
[0162] The blocking relationship between vehicles has a transitive property. When constructing a vehicle relationship graph, the constructed directed graph is simplified based on the repeated blocking relationship. In some embodiments, see Figure 6B , Figure 6B This is a second schematic diagram of vehicle relationships provided by an embodiment of the present application; the vehicle position example 602 shows four vehicles in a blocking relationship, and the blocking relationship is converted into a vehicle directed graph example 6021, in which the vehicle marked as 3 is blocked by vehicles marked as 4, 6, and 10, and the blocking relationship between vehicles marked as 4 and 10 is a repeated blocking relationship ( Figure 6B In this case, only one blocking method needs to be retained, so the constructed vehicle directed graph example 6021 can be simplified and the repeated blocking relationship shown by the dotted line can be omitted.
[0163] Continue to see Figure 4 ,In step 402, a passenger sequence is generated based on the out-degree of each node in the vehicle relationship graph.
[0164] For example, the out-degree is the number of elements in the set of ordered pairs of directed edges with a particular vehicle as a node in a vehicle relationship graph. For example, in a vehicle relationship graph E, the out-degree of node a is the number of elements b in the set of ordered pairs of directed edges with a as a node {(a,b)|b∈E}, which is also the original out-degree of node a. The original out-degree and relative out-degree of each node are calculated. The relative out-degree is calculated by searching for all paths starting from node a and ending at node b with an out-degree of 0. The length of the path with the shortest length (i.e., the number of directed edges in this path) is denoted as n. A weight parameter p greater than 0 is defined, and the out-degree is defined as p*n. For two nodes a and b, if the out-degree of a is greater than the out-degree of b, then the out-degree of b is considered to be smaller than that of a. The relative out-degree of a node with an original out-degree of 0 is also 0. All other conditions being equal, a larger weight parameter p results in a more distinct difference in the out-degree values between nodes, and a lower difficulty.
[0165] According to the out-degree of the nodes, prioritize the nodes with smaller out-degrees (especially the nodes with an out-degree of 0, as an out-degree of 0 means that the player can directly move the vehicle represented by the node out). For nodes with the same out-degree, select based on the number of dependencies on parking spaces. Suppose there are m parking spaces, randomly select k nodes with an out-degree of 0, and m - k nodes with an out-degree less than r but not 0. k and r are difficulty coefficients. At this time, the selected m nodes have the highest priority. When generating the passenger sequence, randomly select passengers from the m nodes with the highest priority. The parameters k and r in the process of selecting the out-degree satisfy k + r = m, and k is a positive number. Under the condition that other conditions are the same, the larger the value of K, the simpler the level difficulty.
[0166] In step 403, based on the vehicle attributes and the changes in the passenger sequence, update the vehicle relationship graph and the passenger sequence.
[0167] Here, there is a solvable strategy between the vehicle relationship graph and the passenger sequence.
[0168] For example, during the process of generating the passenger sequence, it is necessary to immediately update the remaining passenger capacity of each node in the vehicle relationship graph. If the remaining passenger capacity of a node's vehicle attribute is 0, then the node will be removed from the graph. When removing the node, all directed edges connecting this node (regardless of whether the directed edge starts from the node or points to the node) will also be deleted, realizing the update of the vehicle relationship graph and the passenger sequence.
[0169] For example, select m nodes with the highest priority, draw passengers from the nodes with the highest priority and update the remaining passenger capacity. For example: The initial attributes of node a are (yellow vehicle, full load of 10 people, remaining 10 people). Draw 6 from it (the number of drawn people is randomly selected from the pre-set integers). After drawing, update the attributes of node a. The updated node attributes are (yellow vehicle, full load of 10 people, remaining 4 people). The 6 drawn yellow passengers will be added to the passenger sequence. Until the remaining number of a node with an out-degree of 0 among the m nodes is 0, a prerequisite for randomly drawing passengers is that the first node to be emptied must have an out-degree of 0. Then delete the node, and at the same time update the out-degree of all nodes in the directed graph, and then select a new node that meets the conditions (that is, the out-degree is 0 or < r) to form m nodes.
[0170] In step 404, based on the vehicle relationship graph and the passenger sequence with a solvable strategy, generate the corresponding game level.
[0171] For example, based on a vehicle relationship graph and a passenger sequence with a solvable strategy, a reasonable vehicle relationship graph is constructed. All passengers are on the vehicle. At this time, there are no passengers at the vehicle station. Select a node (i.e., a vehicle) in the directed graph and drive the vehicle to the parking space. Passengers begin to get off the vehicle. Passengers who get off the vehicle need to line up in order at the waiting area until a vehicle is empty. At this time, the vehicle leaves the parking space, and a parking space is vacated. Then, another vehicle is selected and brought to the parking space. This process is repeated until all vehicles have left the parking space, that is, all passengers have gotten off the vehicle. The process of passengers getting off the vehicle corresponds to the process of passengers getting on the vehicle. The process of getting on and off the vehicle ensures that the solvable rows of the boarding level are constructed. That is, there is a solvable strategy between the vehicle relationship graph and the passenger sequence, and the corresponding game level is automatically generated at this time.
[0172] For example, when a player uses a prop to change the color of a vehicle or the sequence of passengers, the vehicle relationship diagram and the remaining passenger sequence are re-analyzed, and the vehicle color or passenger sequence is dynamically adjusted to maintain the solvability of the level. A prop button is provided in the human-computer interaction interface of the game level, allowing players to change the color configuration of the passenger sequence by triggering the prop button without any idea. After triggering the prop, the passenger sequence on the field is regenerated once (a random refresh is conveyed to the player). When the passenger sequence needs to be refreshed, the passenger sequence is regenerated according to the current level configuration and the vehicles on the field. In this case, no matter how the player adjusts, the game can still maintain the existence of the level solution, and the difference in difficulty before and after the adjustment will not be too large, ensuring that the player's gaming experience is stable when using props, and the game will not lose its challenge or become impossible to pass due to uncontrollable changes.
[0173] In some embodiments, after generating a game level, the difficulty of the generated level is evaluated by a level difficulty evaluation model based on factors such as the complexity of the passenger sequence and the number of obstacles between vehicles. By adjusting the generation parameters, the difficulty is controlled within the expected range. The evaluation model can be a deep neural network. By inputting the parameters of the game level into the deep neural network, the difficulty of the level is predicted based on the trained weights and activation function, and the predicted difficulty value is output. The level is classified into different difficulty levels based on the output difficulty value. For example: if the difficulty value is between 0 and 0.3, the corresponding level difficulty is classified as the elementary difficulty level; if the difficulty value is between 0.3 and 0.7, the corresponding level difficulty is classified as the intermediate difficulty level; and if the difficulty value is greater than 0.7, the corresponding level difficulty is classified as the advanced difficulty level.
[0174] For example, the complexity of the passenger sequence is determined by randomly drawing passengers from the highest-priority node. For example, in the first scenario, each passenger draw assumes that all passengers in the vehicle are removed at once, leaving it empty. In the second scenario, the draw is completely random and irregular. All other conditions being equal, the level generated by the second scenario will be more difficult than the first. This is because the player's car will pick up passengers more smoothly during the game, the probability of occupied parking spaces will increase, and the error tolerance will be reduced. The lower the level of difficulty, the simpler the method for drawing the passenger sequence. Sequence complexity is a dimension of level difficulty and affects the player's smooth gameplay.
[0175] In some embodiments, after generating a game level, the player's win rate is counted, and a curve fitting is performed with the win rate as the dependent variable and a linear combination of the level difficulty parameters as the independent variable. The best fitting solution is selected to map the parameters and difficulty, and the mapping relationship is used as the basis for difficulty adjustment and evaluation.
[0176] For example, during the level generation and adjustment process, exception handling is also performed to solve the problem of no solution or timeout in the level generation process. This is achieved by real-time detection of the directed graph. For example, when designing the vehicle placement, the level planner may cause an error in the level. Figure 6C , Figure 6C This is the third schematic diagram of the vehicle relationship provided by the embodiment of the present application. The four vehicles shown in the vehicle position example 603 form an infinite loop. At this time, there is no solution according to the corresponding vehicle directed graph example 6031. In the vehicle directed graph example 6031, starting from a certain node, there is a path along the directed edge that can return to the node itself, then the level has no solution. In the process of designing a level with dozens or even hundreds of vehicles, there is a probability that some of the vehicles in the level form a loop. In the process of generating the level in step 404, a detection is added to determine whether there is a loop in the vehicle relationship graph. When adding a vehicle node causes a loop to be generated, a prompt is triggered. The vehicle nodes in the loop are deleted or adjusted according to the situation of the loop to avoid the situation where the level has no solution.
[0177] The interactive processing method of the virtual scene provided in the embodiment of the present application has the following beneficial effects:
[0178] Based on the vehicles and their positional relationships, a directed graph of vehicle relationships is constructed. Based on the out-degree of each node in the vehicle relationship graph, nodes with smaller out-degrees are prioritized. These nodes correspond to different vehicles, each with a vehicle color and passenger attributes. Priorities are established based on the out-degree of each node. Passengers are randomly selected from the highest-priority node, and the node attributes in the directed graph are updated promptly to generate a passenger sequence, saving both time and design costs in level development. When the player uses a power-up to change the vehicle color or passenger sequence, a certain number of passengers of the same color are added to the sequence in an orderly manner. The directed graph and the remaining passenger sequence are reanalyzed, and the vehicle color or passenger sequence is dynamically adjusted to ensure that the generated level is always solvable. By combining the directed graph and sequence structure, dynamic game level generation is achieved, reducing errors caused by human error. During the level generation and adjustment process, exceptions indicating unsolvable situations are displayed to ensure solvability. Based on the vehicle relationship graph and passenger sequence with a solvable strategy, the corresponding game level is generated and the game level before the use of props is updated. The generation parameters used in the process of generating the game level are consistent with the generation parameters before the modification. By controlling the complexity of the passenger sequence and the number of vehicle obstructions, the difficulty control before and after the level update is maintained to ensure the player's gaming experience.
[0179] The following continues to describe the exemplary structure of the virtual scene interactive processing device 455 provided in the embodiment of the present application implemented as a software module. In some embodiments, such as Figure 2A As shown, the software modules in the interactive processing device 455 of the virtual scene stored in the memory 450 may include: a level generation module 4551, which is used to generate a first directed graph based on the attributes of multiple virtual vehicles in the virtual scene, wherein the first directed graph includes nodes corresponding to the virtual vehicles, and the directed edges between the nodes represent the positional relationship between the virtual vehicles; determine the out-degree parameter of each virtual vehicle in the first directed graph, wherein the out-degree parameter represents the number of edges with the virtual vehicle as a node; sample the multiple virtual vehicles in ascending order of the out-degree parameter to obtain multiple first seats, and generate a first virtual pair based on the multiple first seats. A first virtual object sequence is configured, wherein a first seat is used to carry a virtual object in a first virtual object sequence; a first level is generated based on the properties of multiple virtual vehicles and the first virtual object sequence, and the first level is loaded into the virtual scene; a level update module 4552 is configured, when the first virtual object sequence is modified, to sample multiple second seats from multiple virtual vehicles in the first directed graph in ascending order of out-degree parameters, and generate a second virtual object sequence matching the multiple second seats; a second level is generated based on the properties of the multiple virtual vehicles and the second virtual object sequence, and the first level in the virtual scene is updated to the second level.
[0180] In some embodiments, the level generation module 4551 is also used to generate multiple nodes corresponding to multiple virtual vehicles; based on the positional relationship between the virtual vehicles, generate directed edges between the nodes corresponding to the virtual vehicles; according to the transmission relationship of the directed edges, remove the repeated directed edges in the positional relationship graph, and obtain the positional relationship graph after removal as the first directed graph.
[0181] In some embodiments, the level generation module 4551 is also used to initialize a first out-degree matrix that conforms to the number of rows and columns using the number of nodes of the virtual vehicles in the first directed graph as the number of rows and columns, wherein the initial value of each element in the row where each node in the first out-degree matrix is located is zero; update the element value of each element in the first out-degree matrix according to the nodes that constitute the directed edges in the first directed graph, wherein the element value of the directed edge starting from the node is set to a preset value; traverse the element values in the row corresponding to each node in the matrix after the update, and use the element value in the row as the number of preset values as the out-degree parameter of the node corresponding to each virtual vehicle.
[0182] In some embodiments, the level generation module 4551 is further used to sort the out-degree parameter of each virtual vehicle in ascending order to obtain an ascending sequence of the out-degree parameters; sample the vacant seats in the virtual vehicle in the order of the ascending sequence to obtain a first preset number of first seats with an out-degree parameter of zero and a second preset number of first seats with an out-degree parameter of non-zero; and arrange the virtual objects that match the first preset number of first seats with an out-degree parameter of zero and the second preset number of first seats with an out-degree parameter of non-zero according to the sampling order to obtain a first virtual object sequence.
[0183] In some embodiments, the level update module 4552 is further configured to sample the vacant seats in the virtual vehicle according to an ascending sequence of out-degree parameters to obtain a first preset number of second seats with an out-degree parameter of zero and a second preset number of second seats with an out-degree parameter of non-zero; and sort the virtual objects that match the first preset number of second seats with an out-degree parameter of zero and the second preset number of second seats with an out-degree parameter of non-zero according to a sampling order to obtain a second sequence of virtual objects that match the plurality of second seats.
[0184] In some embodiments, after generating a first virtual object sequence based on multiple first seats, the level generation module 4551 is further used to calculate the number of free seats for each virtual vehicle in the first directed graph based on the first virtual object sequence; when the number of free seats is zero, remove the node of the virtual vehicle from the first directed graph, and update the properties of the remaining virtual vehicles after the removal; and modify the first directed graph according to the updated properties of the remaining virtual vehicles.
[0185] In some embodiments, after the first level is loaded in the virtual scene, the level update module 4552 is further used to perform the following processing when both the properties of the virtual vehicle and the first virtual object sequence are modified: generating a second directed graph based on the modified properties of the virtual vehicle, and determining the out-degree parameter of each virtual vehicle in the second directed graph; sampling the modified virtual vehicle according to the ascending sequence of the out-degree parameter of each virtual vehicle in the second directed graph to obtain multiple third seats; generating a third virtual object sequence matching the multiple third seats, wherein the third virtual object sequence is different from the first virtual object sequence; generating a third level based on the modified properties of the multiple virtual vehicles and the third virtual object sequence, and updating the first level to the third level in the virtual scene.
[0186] In some embodiments, the level update module 4552 is also used to evaluate the properties of the virtual vehicle before modification and the first virtual object sequence before modification to determine the interaction parameters of the first level; modify the positional relationship between the virtual vehicles according to the interaction parameters, and generate a second directed graph according to the modified positional relationship between the virtual vehicles; initialize a second out-degree matrix that conforms to the number of rows and columns with the number of nodes of the virtual vehicles in the second directed graph as the number of rows and columns, wherein the initial value of each element in the row where each node in the second out-degree matrix is located is zero; update the element value of each element in the second out-degree matrix according to the nodes that constitute the directed edges in the second directed graph, wherein the element value of the directed edge starting from the node is set to a preset value; traverse the element values in the row corresponding to each node in the matrix after the update, and use the element values in the matrix row as the number of preset values as the out-degree parameters of the node corresponding to each virtual vehicle.
[0187] In some embodiments, before generating a second directed graph based on the modified properties of the virtual vehicle, the level update module 4552 is also used to traverse the path in the second directed graph; when a closed path is found and the closed path does not contain repeated directed edges and nodes, an exception prompt message is generated, wherein the exception prompt message is used to prompt that there is an error in the positional relationship between the virtual vehicles in the second directed graph; and the properties of the virtual vehicles with incorrect positional relationships in the second directed graph are modified.
[0188] The present invention provides a computer program product comprising a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the virtual scene interactive processing method described in the present invention.
[0189] The embodiment of the present application provides a computer-readable storage medium in which computer-executable instructions or computer programs are stored. When the computer-executable instructions or computer programs are executed by a processor, the processor will execute the method for processing question-and-answer data provided in the embodiment of the present application, for example, Figure 3A The interactive processing method of the virtual scene is shown.
[0190] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
[0191] In some embodiments, computer-executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0192] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinating files (e.g., files storing one or more modules, subroutines, or code portions).
[0193] By way of example, computer-executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed across multiple sites and interconnected by a communication network.
[0194] In summary, through the embodiments of the present application, a first directed graph is generated based on the attributes of multiple virtual vehicles in a virtual scene. Multiple virtual vehicles are sampled in ascending order of the out-degree parameters of each virtual vehicle in the first directed graph to generate a first virtual object sequence. A first level is generated based on the attributes of the multiple virtual vehicles and the first virtual object sequence. By combining the directed graph and the virtual object sequence, the solvability of the first level is ensured, the efficiency of level generation is improved, and server computing resources are conserved. If the attributes of the first virtual object sequence or virtual vehicle are modified, the solvability of the level is maintained and the difficulty of the level before and after the modification is kept controllable by controlling the generation parameters of the directed graph and virtual object sequence during the level update process, using the same sampling method as the first level.
[0195] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the scope of protection of the present application.
Claims
1. A method for interactive processing of a virtual scene, characterized in that: The method comprises: Generating a first directed graph based on the attributes of a plurality of virtual vehicles in the virtual scene, wherein each of the virtual vehicles is regarded as a node in the first directed graph, and the positional relationships between the virtual vehicles are regarded as directed edges in the first directed graph; Determine an out-degree parameter of each virtual vehicle in the first directed graph, wherein the out-degree parameter represents the number of directed edges starting from the virtual vehicle; Sampling the plurality of virtual vehicles according to an ascending sequence of the out-degree parameters to obtain a plurality of first seats, and generating a first virtual object sequence based on the plurality of first seats, wherein one of the first seats is used to carry one of the virtual objects in the first virtual object sequence; generating a first level based on the properties of the plurality of virtual vehicles and the first virtual object sequence, and loading the first level into the virtual scene; In a case where the first virtual object sequence is modified, sampling a plurality of second seats from the plurality of virtual vehicles in the first directed graph according to an ascending sequence of the out-degree parameters, and generating a second virtual object sequence matching the plurality of second seats; A second level is generated based on the properties of the multiple virtual vehicles and the second virtual object sequence, and the first level in the virtual scene is updated to the second level.
2. The method according to claim 1, characterized in that Generating a first directed graph based on the attributes of a plurality of virtual vehicles in the virtual scene includes: generating a plurality of nodes corresponding to the plurality of virtual vehicles respectively; Based on the positional relationship between the virtual vehicles, generating directed edges between the nodes corresponding to the virtual vehicles; According to the transitive relationship of the directed edges, repeated directed edges in the position relationship graph are removed, and the position relationship graph after removal is obtained as the first directed graph.
3. The method according to claim 1, characterized in that Determining the out-degree parameter of each virtual vehicle in the first directed graph includes: Initializing a first out-degree matrix that matches the number of rows and columns, using the number of nodes of the virtual vehicle in the first directed graph as the number of rows and columns, wherein the initial value of each element in the row where each node in the first out-degree matrix is located is zero; updating the element value of each element in the first out-degree matrix according to the nodes constituting the directed edges in the first directed graph, wherein the element value of the element with the directed edge starting from the node is set to a preset value; The element values in the row corresponding to each of the updated nodes in the matrix are traversed, and the element values in the row are set to the number of preset values as the out-degree parameters of each of the virtual vehicles.
4. The method according to claim 1, wherein The step of sampling the plurality of virtual vehicles to obtain a plurality of first seats according to the ascending sequence of the out-degree parameters, and generating a first virtual object sequence based on the plurality of first seats, comprises: Sorting the out-degree parameter of each virtual vehicle in ascending order to obtain an ascending sequence of the out-degree parameters; Sampling the vacant seats in the virtual vehicle in the order of the ascending sequence to obtain a first preset number of first seats whose out-degree parameters are zero and a second preset number of first seats whose out-degree parameters are not zero; The virtual objects that match the first preset number of first seats whose out-degree parameters are zero and the second preset number of first seats whose out-degree parameters are not zero are arranged in a sampling order to obtain a first virtual object sequence.
5. The method according to claim 4, characterized in that The step of sampling a plurality of second seats from the plurality of virtual vehicles in the first directed graph according to the ascending sequence of the out-degree parameters and generating a second virtual object sequence matching the plurality of second seats comprises: Sampling the vacant seats in the virtual vehicle according to the ascending sequence of the out-degree parameters to obtain the first preset number of second seats whose out-degree parameters are zero and the second preset number of second seats whose out-degree parameters are not zero; The virtual objects that match the first preset number of second seats whose out-degree parameters are zero and the second preset number of second seats whose out-degree parameters are not zero are sorted according to the sampling order of the sampling to obtain a second virtual object sequence that matches the multiple second seats.
6. The method according to any one of claims 1 to 5, characterized in that After generating a first virtual object sequence based on the plurality of first seats, the method further includes: Calculating the number of vacant seats for each of the virtual vehicles in the first directed graph according to the first virtual object sequence; When the number of available seats is zero, removing the node of the virtual vehicle from the first directed graph, and updating the attributes of the remaining virtual vehicle after the removal; The first directed graph is modified according to the updated remaining attributes of the virtual vehicle.
7. The method according to claim 1, characterized in that After loading the first level in the virtual scene, the method further includes: When both the attributes of the virtual vehicle and the first virtual object sequence are modified, the following processing is performed: generating a second directed graph based on the modified attributes of the virtual vehicle, and determining an out-degree parameter of each virtual vehicle in the second directed graph; Sampling the modified virtual vehicle to obtain a plurality of third seats according to an ascending sequence of out-degree parameters of each virtual vehicle in the second directed graph; generating a third virtual object sequence matching the plurality of third seats, wherein the third virtual object sequence is different from the first virtual object sequence; A third level is generated based on the modified properties of the plurality of virtual vehicles and the third virtual object sequence, and the first level is updated to the third level in the virtual scene.
8. The method according to claim 7, characterized in that Generating a second directed graph based on the modified attributes of the virtual vehicle, and determining the out-degree parameter of each virtual vehicle in the second directed graph, includes: evaluating the properties of the virtual vehicle before modification and the first virtual object sequence before modification to determine interaction parameters for the first level, wherein the interaction parameters are determined based on the properties of the virtual vehicle and the complexity of the first virtual object sequence; modifying the positional relationship between the virtual vehicles according to the interaction parameter, and generating the second directed graph according to the modified positional relationship between the virtual vehicles; Initializing a second out-degree matrix that matches the number of rows and columns, using the number of nodes of the virtual vehicle in the second directed graph as the number of rows and columns, wherein the initial value of each element in the row where each node in the second out-degree matrix is located is zero; updating the element value of each element in the second out-degree matrix according to the nodes constituting the directed edge in the second directed graph, wherein the element value of the element with the directed edge starting from the node is set to a preset value; The element values in the row corresponding to each of the updated nodes in the matrix are traversed, and the element values in the matrix row are set to the number of preset values as the out-degree parameters of each of the virtual vehicles.
9. The method according to claim 7, characterized in that Before generating the second directed graph based on the modified attributes of the virtual vehicle, the method further includes: Traversing the paths in the second directed graph; When a closed path is found and the closed path does not contain repeated directed edges and nodes, generating an abnormal prompt message, wherein the abnormal prompt message is used to prompt that there is an error in the positional relationship between the virtual vehicles in the second directed graph; Modify the attributes of the virtual vehicle that has an incorrect position relationship in the second directed graph.
10. An interactive processing device for a virtual scene, characterized in that: The device comprises: A level generation module is configured to generate a first directed graph based on the properties of a plurality of virtual vehicles in a virtual scene, wherein each virtual vehicle is regarded as a node in the first directed graph, and the positional relationships between the virtual vehicles are regarded as directed edges in the first directed graph; determine an out-degree parameter for each virtual vehicle in the first directed graph, wherein the out-degree parameter represents the number of directed edges starting from the virtual vehicle; sample the plurality of virtual vehicles in ascending order of the out-degree parameters to obtain a plurality of first seats; generate a first virtual object sequence based on the plurality of first seats, wherein one of the first seats is used to carry one of the virtual objects in the first virtual object sequence; generate a first level based on the properties of the plurality of virtual vehicles and the first virtual object sequence, and load the first level into the virtual scene; A level update module is configured to, when the first virtual object sequence is modified, sample a plurality of second seats from the plurality of virtual vehicles in the first directed graph in ascending order of the out-degree parameters to generate a second virtual object sequence matching the plurality of second seats; generate a second level based on attributes of the plurality of virtual vehicles and the second virtual object sequence, and update the first level in the virtual scene to the second level.
Citation Information
Patent Citations
Path finding method and device in virtual scene, equipment and storage medium
CN114377397A
Bayonet point location classification method and device based on road network and computer storage medium
CN116049338A