Virtual scene interaction processing method and device, equipment and storage medium

By generating directed graphs and virtual object sequences in virtual scenes, the game levels are automatically generated and updated, and the problems of high level design workload and uncontrollable difficulty in the existing technology are solved, and efficient and balanced level generation and difficulty control are achieved.

CN119633389AActive Publication Date: 2025-03-18BEIJING QIMIAO KINGDOM TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510024193.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-03-18
Estimated Expiration
2045-01-07

AI Technical Summary

Technical Problem

In the prior art, the design workload of game levels is large, the time cost is high, and it is difficult to achieve automatic generation and difficulty control of levels, resulting in uncontrollable difficulty during the game process, which may lead to program dead loops and game lag.

Method used

By generating the first directed graph in the virtual scene, a virtual object sequence is dynamically generated based on the properties and output parameters of the virtual vehicle, and then the levels are automatically generated and updated to ensure the solvability and difficulty balance of the levels.

Benefits of technology

It realizes automatic generation and difficulty control of game levels, reduces the time cost of manual design and layout, improves the efficiency and accuracy of level generation, and ensures the stability of game experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119633389A_ABST
    Figure CN119633389A_ABST
Patent Text Reader

Abstract

The invention provides an interactive processing method and device for a virtual scene, equipment and a storage medium. The method comprises the steps of generating a first directed graph based on attributes of a plurality of virtual carriers in a virtual scene and determining out-degree parameters of each virtual carrier; according to an ascending sequence of out-degree parameters, multiple virtual carriers are sampled to obtain multiple first seats, and a first virtual object sequence is generated; generating a first level based on the attributes of the plurality of virtual carriers and the first virtual object sequence; under the condition that the first virtual object sequence is modified, multiple second seats are sampled from multiple virtual carriers of the first directed graph according to an ascending sequence of out-degree parameters, and a second virtual object sequence matched with the multiple second seats is generated; and generating a second level based on the attributes of the plurality of virtual carriers and the second virtual object sequence, and updating the first level in the virtual scene to the second level. By means of the method and device, automatic generation and difficulty control of levels in the virtual scene can be achieved, and game resources are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for level interaction in a virtual scene. Background Art

[0002] Virtual vehicle dispatching games are common puzzle games where players need to move vehicles in a certain order and take away all passengers. The game has multiple levels with different levels of difficulty.

[0003] In the related art, a large number of game levels are manually designed by developers. This design is labor-intensive and time-consuming. Moreover, once the player uses props to change the attributes, the difficulty of the pre-designed level 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 operation, thereby occupying a large amount of resources, easily causing the game to freeze and affecting the gaming experience.

[0004] The related art lacks a solution for realizing automatic generation of levels and difficulty control during the game process. Summary of the invention

[0005] The embodiments of the present application provide a method, device, equipment and storage medium for interactive processing of a virtual scene, which can realize 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 application provides a method for interactive processing of a virtual scene, the method comprising:

[0008] 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 directed edges between the nodes represent positional relationships between the virtual vehicles;

[0009] Determine an out-degree parameter of each of the virtual vehicles in the first directed graph, wherein the out-degree parameter represents the number of edges with the virtual vehicle as a node;

[0010] According to the ascending sequence of the out-degree parameters, the plurality of virtual vehicles are sampled to obtain a plurality of first seats, and a first virtual object sequence is generated 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 the case where the first virtual object sequence is modified, sampling a plurality of second seats from the plurality of virtual vehicles of 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;

[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, 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 the directed edges between the nodes represent the positional relationship between the virtual vehicles; 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; sample the plurality of virtual vehicles in ascending order of the out-degree parameters to obtain a plurality of first seats, and 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 in the virtual scene;

[0016] A level updating module is used to sample 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 to generate a second virtual object sequence matching the plurality of second seats when the first virtual object sequence is modified; generate a second level based on the 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, the 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 programs 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 in the 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 according to the positional relationship between the virtual vehicles with the virtual vehicles as nodes, 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 the 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, and 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 according to the ascending sequence of the out-degree parameter, and a second virtual object sequence matching the multiple second seats is generated. 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 by the same sampling method as the first level, and the difficulty balance of the level update is ensured by controlling the factors that affect the level generation; the second virtual object sequence is generated based on the attributes of 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 game experience and avoid reducing user interest due to the large difference in 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 of 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 of a virtual scene provided in an embodiment of the present application;

[0026] Figure 2A is a first structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0027] Figure 2Bis a second structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0028] Figure 3A It is a first flow chart of the interactive processing method of the virtual scene provided in the embodiment of the present application;

[0029] Figure 3B It is a second flow chart of the interactive processing method of the virtual scene provided in the embodiment of the present application;

[0030] Figure 3C It is a third flow chart of the interactive processing method of the virtual scene provided in the embodiment of the present application;

[0031] Figure 3D It is a fourth flow chart of the interactive processing method of the virtual scene provided in the embodiment of the present application;

[0032] Figure 4 It is a fifth flow chart of the interactive processing method of the virtual scene provided in the embodiment of the present application;

[0033] Figure 5 is a schematic diagram of a vehicle dispatching game provided in an embodiment of the present application;

[0034] Fig. 6A is a first schematic diagram of vehicle relationships provided in an embodiment of the present application;

[0035] Figure 6B is a second schematic diagram of vehicle relationships 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 superiority or inferiority of the solutions or the priority in the implementation process. DETAILED DESCRIPTION

[0038] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the 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 describe 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 with 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: It is a puzzle game derived from the Huarong Road. Its core gameplay is similar to the classic Huarong Road or parking games, and a new mechanism of carrying passengers is added on its basis. In the bus dispatch game, there is a parking lot and a passenger team. The main goal of the player is to move all vehicles out of a crowded square by moving various vehicles and pick up all passengers according to specific rules.

[0045] 2) Directed Graph: It 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, 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 to enter the queue is the first element to be removed.

[0049] In the related technologies, a large number of game levels are manually designed by developers, and the difficulty of the game can be controlled to a certain extent during the design process. However, the workload of level design is large, the time cost is high, and the level adjustment is difficult. Once the player uses props to change the attributes, the pre-designed solution may become invalid, resulting in a change in the difficulty of the level or no solution. The related technologies cannot achieve dynamic adjustment of game levels, and the load pressure of repeatedly calling the server to process level data is high, which can easily cause game lag and affect the gaming experience.

[0050] The 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 automatic generation and difficulty control of levels in a virtual scene to save game resources.

[0051] The following describes an exemplary application of the electronic device provided in the embodiments of the present application. The device provided in the embodiments of the present application can be implemented as various types of terminals such as a laptop computer, a tablet computer, a desktop computer, a set-top box, a smart phone, a smart speaker, a smart watch, a smart TV, and a vehicle-mounted terminal, and can also be implemented as a server. The following describes an exemplary application when the device is implemented as a terminal or a server.

[0052] See also Figure 1A , Figure 1A This is a first schematic diagram of an application mode of an interactive processing method for a virtual scene provided in an embodiment of the present application, for implementing a level processing application supporting a virtual scene, for example, Figure 1A The system involves a server 200, a network 300, a terminal device 400 and a database 500. 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 the level data information from the database 500, sends the level data information to the terminal device 400 through the network 300, and loads the level in the virtual scene on the terminal device 400. The user arranges virtual vehicles (such as vehicles, ships, etc.) in the virtual scene loaded by the terminal device 400, and the user controls the virtual vehicle to move according to the preset rules of the level to complete the clearance goal of the level. In the case where the user uses props on the terminal device 400 to modify the virtual object sequence in the virtual scene, the terminal device 400 sends the user's request to modify the virtual object sequence to the server 200 through 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 according to 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 according to the newly generated virtual object sequence and the first directed graph. The newly generated level is sent to the terminal device 400 through the network 300 for loading, and the user continues to perform the arrangement operation of the virtual vehicle 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 scene of game level generation, the user can be the developer of the game, and in the scene 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 in a virtual scene on the terminal device 400, and the user arranges virtual vehicles (such as vehicles, ships, etc.) in the virtual scene loaded by the terminal device 400. The user controls the virtual vehicle to move according to the preset rules of the level to complete the clearance goal of the level. In the case where the user uses props on the terminal device 400 to modify the virtual object sequence in the virtual scene, in response to receiving a request to modify the virtual object sequence, the terminal device 400 samples the seats in the virtual vehicle according to 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, generates a new level according to the newly generated virtual object sequence and the first directed graph, and loads it in the terminal device 400. 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.

[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 the 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] 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 disk drives, optical disk 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 a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. 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, 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 exemplarily described below.

[0064] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0065] A network communication module 452, used to reach other electronic devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 include: Bluetooth, Wireless Compatibility Certification (WiFi), and Universal Serial Bus (USB), etc.;

[0066] a presentation module 453 for enabling presentation of information via one or more output devices 431 (e.g., display screen, speaker, etc.) associated with the user interface 430 (e.g., a user interface for operating peripherals and displaying content and information);

[0067] The input processing module 454 is used to detect one or more user inputs or interactions from one of the one or more input devices 432 and translate the detected inputs or interactions.

[0068] In some embodiments, the device provided in the embodiments of the present application can be implemented in software. Figure 2A The interactive processing device 455 of the virtual scene stored in the memory 450 is shown, which can be software in the form of programs and plug-ins, including the following software modules: a level generation module 4551 and a level update module 4552. These modules are logical, so they can be arbitrarily combined or further divided 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 that can only include the level generation module 4551. The functions of each module will be explained below.

[0069] See also Figure 2B , Figure 2B FIG2 is a second structural diagram of an electronic device provided by an embodiment of the present application. The server 200 shown in FIG2 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 through a bus system 240. It can be 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, in 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 disk drives, optical disk 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 a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. 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, 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 exemplarily described below.

[0074] Operating system 251, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing 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 device provided in the embodiments of the present application can be implemented in software. Figure 2B The interactive processing device 255 of the virtual scene stored in the memory 250 is shown, which can be software in the form of programs and plug-ins, including the following software modules: a level generation module 2551 and a level update module 2552. These modules are logical, so they can be arbitrarily combined or further divided according to the functions implemented. Figure 2BFor the sake of convenience, all the above modules are shown at once, but it should not be considered that the level interaction device 255 of the virtual scene excludes the implementation that can only include 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 question and 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 can be run only by downloading it to a browser environment. 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 explained 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 implementing the interactive processing method of the virtual scene of the embodiment of the present application may 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 is a first flow chart of the interactive processing method of the virtual scene provided in 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, and 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 vehicle can be a vehicle with a plurality of 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 the virtual vehicles, the total number of seats, and the number of free 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, and each ordered pair (u, v) represents a directed edge from node u to node v. Each virtual vehicle is taken as a node, and the positional relationship between the virtual vehicle nodes is taken as a directed edge to construct a first directed graph corresponding to a plurality of 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, and each node has a set of attributes, which defines 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; based on the positional relationship between the virtual vehicles, generating directed edges between the nodes corresponding to the virtual vehicles; according to the transmission relationship of the directed edges, removing the repeated directed edges in the positional relationship graph, and obtaining the positional relationship graph after removal as the first directed graph.

[0085] For example, the positional relationship is the relationship formed by the relative position and movement direction restrictions between virtual vehicles in the 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 multiple virtual vehicles, one node represents one virtual vehicle, and the number of nodes is consistent with 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 between the corresponding nodes are generated according to the obstruction relationship. The obstruction relationship is a type of positional relationship, which represents that the movement of a virtual vehicle is blocked by another vehicle. The nodes corresponding to the two virtual vehicles are connected by directed edges, and the blocked virtual vehicle needs to move away from the other virtual vehicle before it can move. In the positional relationship, since there is 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 transfer relationship. The transfer relationship can identify and remove duplicate directed edges implicitly represented by other directed edges.

[0086] In the embodiment of the present application, the 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, and 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, and 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 Fig. 6A , Fig. 6A It is the first schematic diagram of the vehicle relationship provided by the embodiment of the present application; according to the positional relationship between the virtual vehicles in the virtual scene, a vehicle position relationship diagram is constructed, for example: there are four cars of different colors, and the positional relationship is shown in the vehicle position example 601. The number on each car represents the number of passengers that the vehicle can currently carry (i.e., the number of free seats). When one of the cars is blocked by other vehicles, there is a directed edge between the two vehicle nodes. In the vehicle position example 601, the car with the vehicle mark of 3 blocks the vehicle with the vehicle mark of 4, the cars with the vehicle marks of 3 and 10 both block the car with the vehicle mark of 6, and the car with the vehicle mark of 6 blocks the car with the vehicle mark of 4. The vehicle position example 601 is converted into a vehicle directed graph example 6011 according to the blocking relationship.

[0088] In some embodiments, the blocking relationship between vehicles has a transitive attribute. When generating the first directed graph, directed edges with repeated blocking relationships may be removed. Figure 6B , Figure 6B6 is a second schematic diagram of vehicle relationships provided by an embodiment of the present application. The vehicle position example 602 shows four vehicles having 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 node 4, node 6, and node 10, and the blocking relationship between node 4 and node 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 a 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, the positional relationship between the nodes is represented by directed edges, and dynamic adjustment is achieved according to the changes in the attributes 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 Fig. 6A , Fig. 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 element value in the row as the number of preset values ​​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, and the initial value of each element in the row where each node in the first out-degree matrix is ​​located is set to zero. Fig. 6A In the directed graph shown, the first out-degree matrix of the four nodes in the vehicle directed graph example 6011 is initialized, and the first out-degree matrix obtained by initialization is a four-by-four matrix, each row and each column is 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 according to 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: the number of directed edges starting from node 4 is 3, 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, node 3 and node 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, namely, node 6 to node 3 and node 6 to node 10. Then 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 node 3 and node 10 is 0. Then 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, and the updated first out-degree matrix is ​​traversed. The number of element values ​​of the corresponding rows in the matrix at each stage is calculated to be a preset value, and the preset value is 1. The number of element values ​​​​of 1 is used as the out-degree parameter of the node, that is, 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 preset values ​​is 3, and the out-degree parameter of node 4 is 3.

[0096] In step 303, a plurality of virtual vehicles are sampled according to an ascending sequence of out-degree parameters to obtain a plurality of first seats, and a first virtual object sequence is generated based on the plurality of 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 represent that the corresponding virtual vehicles are less blocked, and virtual vehicles corresponding to nodes with smaller out-degree parameters are preferentially moved during user interaction. According to the ascending order of out-degree parameters, the free seats in the virtual vehicle are sampled to obtain a plurality of first seats, each of which is used to carry a matching virtual object, and the carried virtual objects are arranged according to the plurality of first seats to generate a first virtual object sequence.

[0099] As an example, see Fig. 6A , Fig. 6A The vehicle directed graph example 3011 in shows a first directed graph consisting of four nodes, 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. According to the ascending order of the out-degree parameters, the node sampling order is node 3 and node 10, node 6 and node 4. It is set that the number of free seats sampled from the virtual vehicle of node 3 is 1, then the number of free seats sampled from the virtual vehicle of node 10 is 2, then the number of free seats sampled from the virtual vehicle of node 6 is 5, and finally the number of 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 the 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 It is a second flow chart of the interactive processing method of the virtual scene provided in the embodiment of the present application; Figure 3A Step 303 in can be performed by executing Figure 3B Steps 3031 to 3033 in are implemented as described in detail 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 free 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, the free seats in the virtual vehicle 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. It is assumed that there are M parking spaces in the virtual scene for the virtual vehicle 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 an out-degree parameter of non-zero are randomly selected. The sum of the first preset number and the second preset number is the number of parking spaces M. Random sampling is performed from the free seats in the virtual vehicle corresponding to the selected nodes to obtain 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.

[0105] In step 3033, the virtual objects matching the first preset number of first seats with out-degree parameters of zero and the second preset number of first seats with out-degree parameters not zero are arranged according to a sampling order to obtain a first virtual object sequence.

[0106] In some embodiments, the attributes of the virtual vehicle include the maximum number of seats allowed to carry virtual objects, the number of free seats, and the color of the virtual vehicle. The number of virtual objects in the first virtual object sequence is the same as the number of first seats. The virtual objects matching the first seats with a first preset number of out-degree parameters of zero and the first seats with a second preset number of out-degree parameters not zero are arranged in a sampling order. If the color of the virtual object is the same as the color of the virtual vehicle to which the first seat belongs, the virtual object is matched to obtain a first virtual object sequence.

[0107] In some embodiments, see Figure 5 , Figure 5 It 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 up 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 a 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 their own attributes, such as 4-passenger vehicles and 6-passenger vehicles. Each virtual object has a color attribute. Virtual vehicles can only carry virtual objects of the same color and can leave the parking lot when they are fully loaded. Virtual vehicles can only move forward in a straight line and cannot turn. The movement of each vehicle will be restricted by other vehicles. Passengers will line up. When the passengers in front of the line have not boarded the car, the virtual objects behind cannot board the car. Users need to move the vehicle in a certain order and carry away 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 properties of the remaining virtual vehicles after the removal are updated; and the first directed graph is modified according to the properties of the remaining virtual vehicles after the removal.

[0110] For example, in the process of generating a virtual object queue according to a first directed graph, the nodes in the first directed graph are updated according to the number of free seats of the virtual vehicles, and the number of free seats of 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 has reached the maximum number allowed to be carried. At this time, the number of virtual objects on the virtual vehicle meets the maximum number of virtual objects carried, 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 starting from the removed node is removed from the first directed graph.

[0111] In the embodiment of the present application, a first virtual object sequence is generated according to the node out-degree parameter in the first directed graph generated by the virtual vehicle, and in the process of generating the virtual object sequence, the attributes of the nodes in the first directed graph are updated according to the idleness of the virtual vehicle, and a matching virtual object sequence is automatically generated according to the attributes of the directed graph, so as to realize the dynamic generation and update of the level, improve the efficiency and accuracy of the level generation, have high adjustability and variability, and ensure the solvability of the level. The dynamic generation of the game level is realized, time cost is saved, and errors caused by human factors are reduced.

[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 through the out-degree parameters of the nodes in the first directed graph. At this time, there is a feasible solution between the first directed graph and the first virtual object sequence. According to the feasible solution, the user removes all virtual vehicles and carries 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 in the virtual scene according to the position relationship and color in the virtual object properties.

[0114] For example, a directed graph representing the position relationship of virtual vehicles is constructed. All virtual objects are on the seats of virtual vehicles. At this time, the sequence of virtual objects waiting to be loaded on the parking space is empty, and there are no virtual objects waiting to get on the vehicle. Select the node in the directed graph, move the virtual vehicle corresponding to the node to the parking space, and let the virtual object get off the virtual vehicle. The virtual objects that get off need to be arranged in order at the waiting area of ​​the parking space until all the virtual objects on the virtual vehicle get off. At this time, the virtual vehicle leaves the parking space, and a parking space is vacant. Continue to move the virtual vehicle to the vacant parking space to let the virtual object get off. Repeat this process until all virtual vehicles leave the parking space, that is, all virtual pairs get off the parking space. The first level generated according to the above idea must have a feasible solution to pass the level, because the passenger queue generated by the virtual object getting off the vehicle is completely corresponding to the process corresponding to the idle space as the virtual object to be loaded.

[0115] For example, different levels correspond to different grades. When the user enters the human-computer interaction interface, he first selects the level he wants to interact with. In the virtual scene, a first level is selected for the user to load according to the level level selected by the user. The first level can be selected in any of the following ways: loading the first level that the user has not loaded, that is, selecting the first level that the user has not played before; loading the first level that has not been completed, that is, selecting the first level that the user has played but not completed; randomly loading any level according to 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 an ascending sequence 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 the interaction process, and the modification of the props provides the user with ideas for continuing the interaction. When the color of the first virtual object sequence is modified, it is necessary to resample the free seats in multiple virtual vehicles in the first directed graph to obtain a new second virtual object sequence that matches the sampled free seats.

[0118] In some embodiments, step 305 can be implemented in the following manner: 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, according to the ascending sequence of the out-degree parameter, the free seats in the virtual vehicle are sampled, and the free seats are seats in the virtual vehicle that do not carry objects. There are positions (i.e., parking spaces) in the virtual scene that allow the virtual vehicle to dock when carrying virtual objects. The first preset number and the 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 free seats is preferentially 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 free seats selected. Then, the second preset number of free seats is selected from the virtual vehicle with an out-degree parameter that is not zero.

[0120] For example: sample free seats from the vertex with the highest priority (out-degree parameter is zero) and update the remaining number of free seats. The initial attributes of node a are (color, maximum number allowed to be carried, number of free seats) = (yellow, 10, 10). Six free seats are drawn from them. 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. Repeat the above process of extracting virtual objects 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 free 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 each time by directly removing all the people in the car at once to make it an empty car; the second scheme is completely random and irregular; under the same other conditions, the level generated by the second scheme is more difficult than the first scheme, because the fluency of the virtual vehicle carrying the virtual object in the game process will be reduced under the second scheme, and when the parking space is occupied, it takes longer to remove the virtual vehicle from the parking space, and the difficulty of interaction increases.

[0122] In the embodiment of the present application, according to the first preset number and the second preset number which are the same as those for generating the first virtual object sequence, when the color of the virtual object sequence is modified, the complexity of the regenerated second virtual object sequence is 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 plurality of 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 properties of multiple virtual vehicles, and a second virtual object sequence is generated through the out-degree parameters of the nodes in the second directed graph. At this time, there is a feasible solution between the second directed graph and the second virtual object sequence. According to the feasible solution, the user removes all virtual vehicles and carries all virtual objects in the second virtual object sequence. A second level is generated according to the second directed graph and the second virtual object sequence. According to the positional relationship and color in the virtual object properties, the second level is loaded in the virtual scene, and the first level in the virtual scene is updated to the second level. The user continues to perform the virtual vehicle removal operation according to 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 in the embodiment of the present application; when 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 simultaneously changes the color of the virtual vehicle and the color of the first virtual object sequence by using props, and based on the properties of the modified virtual vehicle, uses the modified virtual vehicle as a node, connects the directed edges between the nodes according to the positional relationship between the nodes, generates a second directed graph, and calculates the out-degree parameters of each node of the virtual vehicle in the second directed graph.

[0128] In some embodiments, see Figure 3D , Figure 3D It is a fourth flow chart of the interactive processing method of the virtual scene provided in the embodiment of the present application; Figure 3C Step 3041 in the Figure 3D Steps 30411 to 3415 in are implemented as described in detail 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 properties of the virtual vehicle and the complexity of the virtual object sequence determine the interaction parameters of the current first level. The properties of the virtual vehicle before modification and the first virtual object sequence before modification are evaluated by calling an evaluation model. The evaluation model can be a deep neural network. The properties of the virtual vehicle before modification and the first virtual object sequence before modification are input into the deep neural network, and the predicted probability of the interaction parameters is output. The interaction parameters of different levels are different. The current level is classified according to the output predicted probability to determine the interaction parameters of the first level. For example, the interaction parameters of the first level are set to include three dimensions: simple, medium and difficult. When the output predicted probability is between 0 and 0.3, the interaction parameters of the first level are simple. When the output predicted probability is between 0.3 and 0.7, the interaction parameters of the first level are medium. When the output predicted probability is between 0.7 and 1, the interaction parameters of 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 attributes and complexities of virtual object sequences. 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 obstructions as the virtual vehicles before the modification is maintained. According to the obstruction 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 obstructions 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 with 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 parameters of each virtual vehicle node are calculated. The out-degree of the node is the number of directed edges starting from each virtual vehicle node in the second directed graph. The number of nodes of the virtual vehicles in the second directed graph is used as the number of rows and columns, and the second out-degree matrix that conforms to the number of rows and columns is initialized. The initial value of each element of the row where each node is located in the second out-degree matrix is ​​set to zero. The initialization principle of 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 embodiments 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, which will not be repeated here.

[0141] In some embodiments, before executing step 3041, the second directed graph is also modified in the following manner: the paths in the second directed graph are 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, there are multiple paths composed of directed edges in the second directed graph, each path contains at least three nodes, and each path is traversed from each node. When a closed path is found, the nodes that make up the closed path are both the starting point and the end point in the closed path. At this time, the directed edges between the nodes form a loop, and the second directed graph has no solution. By triggering the abnormal prompt control, an abnormal prompt message can be generated to prompt the developer that there is an incorrect positional relationship between the virtual vehicles in the second directed graph, causing the current second directed graph to have no solution and need to be modified.

[0143] In some embodiments, see 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 a closed path. At this time, the corresponding vehicle directed graph example 6031 has no solution. 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 the level, there is a probability that some vehicles in the level form a loop. When a closed path is found, a prompt is triggered, and the nodes in the loop are deleted or adjusted according to the situation of the closed path to avoid the situation where the level has no solution.

[0144] In the embodiment of the present application, by detecting whether there is a closed path during the generation process 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 free seats in the modified virtual vehicle are sampled according to the ascending sequence of the out-degree parameter of each virtual vehicle in the second directed graph. According to the first preset number and the second preset number that are the same as those for constructing the first virtual object sequence, the first preset number of free seats are preferentially selected from the virtual vehicles with an out-degree parameter of zero, and the out-degree parameter of the node is updated according to the selected number of free seats. Then, the second preset number of free seats are selected from the virtual vehicles with an out-degree parameter that is not zero, the first preset number of free seats are selected from the virtual vehicles with an out-degree parameter of zero, and the second preset number of free seats are selected from the virtual vehicles with an out-degree parameter that is not zero as the third seats.

[0147] In step 3043, a third virtual object sequence matching a 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 of 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 plurality of 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 satisfies 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 set of paths that meet the clearance goal of the third level. According to 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 the embodiment of the present application, a first directed graph is generated based on the attributes of multiple virtual vehicles in a virtual scene, and the virtual vehicles in the virtual scene are represented in the form of a directed graph. Each virtual vehicle is used as a node with attributes, and the positional relationship between the nodes is represented by a directed edge, and the blocking relationship between the virtual vehicles is intuitively displayed. The dynamic design of the virtual vehicle is realized by adjusting the node attributes in the directed graph, saving the time cost and design cost of level development. According to the node out-degree parameter in the first directed graph generated by the virtual vehicle, the first virtual object sequence is generated, and in the process of generating the virtual object sequence, the attributes of the nodes in the first directed graph are updated according to the idleness of the virtual vehicle. Only the attributes of the virtual vehicle need to be edited, and there is no need to spend a lot of time to design the virtual object sequence, which improves the speed and accuracy of level generation, has high adjustability and variability, and ensures the existence of understanding. Through the combination of directed graph and sequence structure, the dynamic generation of game levels is realized, the errors caused by human factors are reduced, and diversified game levels are efficiently generated according to different interactive parameters, which improves the interest of players and the attractiveness of the game. The interactive parameters of the level are determined according to the complexity of the virtual object sequence and the properties of the virtual vehicle. By controlling the generation parameters of the directed graph and the virtual object sequence under the same interactive parameters and adding closed path detection to the directed graph generation process, it is determined that when the user uses props to modify the level properties, the difficulty of the regenerated level is controllable while maintaining the solvability of the level. In the process of level update, there is no need to repeatedly call the server to obtain data, which reduces the load pressure on the server, reduces the difficulty of calculation, avoids the smoothness of the game process affected by server jitter, and ensures the player's gaming experience.

[0152] The following is an explanation of an exemplary application of the embodiments of the present application in a practical application scenario.

[0153] Vehicle dispatching games are a type of puzzle game derived from Huarong Road. The core gameplay is to add a new mechanism of carrying passengers on the basis of the classic Huarong Road. In vehicle dispatching games, there is a parking lot and a team of passengers. The main goal of the player is to move all vehicles out of a crowded square by moving various vehicles and to carry all passengers according to specific rules. Players need to move vehicles in a certain order and carry all passengers. Reasonable planning and strategy are the key to success. The game usually has multiple levels, and the difficulty gradually increases. As the levels advance, the number and layout of vehicles, the color distribution and arrangement order of passengers will become more and more complicated.

[0154] In the related art, the levels and passenger sequences in the game are designed manually. Although a certain degree of control can be achieved during the design, the workload is huge, time-consuming and labor-intensive, and there is no adjustability. Once the player uses props to change the color of the vehicle or passenger, the pre-designed solution may fail, and the level difficulty is easy to get out of control or directly unsolvable, which destroys the player experience. Artificially designed levels may cause players to have aesthetic fatigue in repeated games, reducing the attractiveness of the game. Some games use a simple method of randomly generating passenger sequences. Although this method can save some design costs, it also makes the level difficulty difficult to control, and the quality of the generated levels is uneven. Players may face challenges that are too simple or too complex, which is difficult to meet the needs of players of different levels. In extreme cases, unsolvable levels may be generated, and the solvability of the levels and the stability of the design difficulty cannot be ensured, affecting the player's gaming experience and satisfaction. The related art has great limitations in level design methods and dynamic adjustment capabilities.

[0155] The embodiment of the present application constructs a directed graph according to the blocking relationship of vehicle placement, preferentially identifies nodes with smaller out-degrees, the nodes correspond to different vehicles, each node has the color and passenger attributes of the vehicle, establishes priorities according to the size of the node out-degree, randomly selects passengers from the node with the highest priority, and promptly updates the node attributes in the directed graph. When the player uses props to change the color of the vehicle or the sequence of passengers, a certain number of passengers of the same color are added to the sequence in order, 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 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 may 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 virtual scene of a vehicle dispatching game, there are multiple vehicles placed. There may be obstructions in the positional relationship between vehicles. Each vehicle is abstracted as a node, and each node has the attributes of the corresponding vehicle, including: the vehicle body color, the number of passengers allowed, and the number of remaining passengers. According to the position arrangement and obstruction relationship of the vehicles, the directed edges between the nodes are constructed. For example, if a vehicle A is blocked by another vehicle B, a directed edge (a, b) is added between the nodes a and b corresponding to vehicle A and vehicle B respectively. The ordered pair (a, b) represents a directed edge from node a to node b. According to the directed edges constructed based on the vehicle nodes and the obstruction relationship, the vehicle relationship graph in the current virtual scene is constructed.

[0159] In some embodiments, see Figure 5 , Figure 5 501 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 parking lot, a passenger sequence 502 consisting of multiple passengers is queuing to get on the bus. 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. 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 player can move the vehicle to an 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. It 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.

[0160] In the game interface, each car has the attribute of color and the attribute of the number of passengers (for example: 4-passenger car, 6-passenger car), and each passenger has the attribute of color. A vehicle can only carry passengers of the same color and can leave the parking lot only when it is fully loaded. The vehicle can only move forward in a straight line and cannot turn. The movement of each vehicle will be restricted by other vehicles. Passengers will line up, and if the passengers in front of the line have not boarded the car, the passengers behind cannot board the car. There are places for passengers to board the car in the virtual scene, called parking spaces. Players need to move the vehicle in a certain order and take away all the passengers.

[0161] In some embodiments, see Fig. 6A , Fig. 6AIt is the first schematic diagram of the vehicle relationship provided by the embodiment of the present application; according to 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 the vehicle position example 601. The numbers on each vehicle represent 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 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. According to the blocking relationship, the vehicle position example 601 is converted into a vehicle directed graph example 6011.

[0162] The blocking relationship between vehicles has a transfer attribute. When constructing a vehicle relationship graph, the constructed directed graph is simplified according to the repeated blocking relationship. In some embodiments, see Figure 6B , Figure 6B 6 is a second schematic diagram of vehicle relationships provided by an embodiment of the present application; the vehicle position example 602 shows four vehicles having 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 by omitting the repeated blocking relationship shown by the dotted line.

[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 ordered pair set of directed edges with a certain vehicle as a node in the 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 ordered pair set {(a,b)|b∈E} of directed edges with a as a node, which is also the original out-degree of node a. Calculate the original out-degree and relative out-degree of each node. The relative out-degree is to search for all paths starting from a and ending at node b with an out-degree of 0 for a node a. The length of the path with the shortest length among these paths (that is, the number of directed edges in this path) is recorded as n. Define a weight parameter p greater than 0, and the out-degree is defined as p*n. For two nodes a and b, if the out-degree a is greater than the out-degree b, then it is determined that the out-degree of b is smaller than that of a, and the relative out-degree of the node with an original out-degree of 0 is also 0. When other conditions are the same, the larger the weight parameter p, the more obvious the difference in the numerical value of the out-degree between nodes will be, and the lower the difficulty will be.

[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 this 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 easier 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, in 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 this node will be removed from the graph. When removing the node, all directed edges connecting this node must also be deleted (regardless of whether the directed edge starts from the node or points to the node), to achieve 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 a pre-set integer). 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 this 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, out-degree of 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 the vehicle relationship graph and passenger sequence with a solvable strategy, a reasonable vehicle relationship graph is constructed. All passengers are on the bus. At this time, there are no passengers at the bus station. Select the node (i.e., vehicle) in the directed graph, drive the vehicle to the parking space, and the passengers begin to get off the bus. The passengers who get off the bus need to be arranged in order at the waiting area until a certain car is empty. Then, the car leaves the parking space, and a parking space is vacated. Then continue to select vehicles to come to this parking space, and repeat this process until all cars leave the parking space, that is, all passengers get off the bus. The process of passengers getting off the bus corresponds to the process of passengers getting on the bus. The process of getting on and off the bus ensures that the solvable line of the boarding level is 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 the player uses props to change the color of the 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 the player to change the color configuration of the passenger sequence by triggering the prop button without any idea. After the prop is triggered, the passenger sequence on the field is regenerated once (what is conveyed to the player is a random refresh). When the passenger sequence needs to be refreshed, the passenger sequence is regenerated according to the configuration of the current level and the vehicles on the field. In this case, no matter how the player adjusts, the game can still maintain the existence of the solution to the level, and the difficulty difference before and after the adjustment will not be too different, ensuring that the player has a stable gaming experience 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 the game level is generated, the difficulty of the generated level is evaluated by the level difficulty evaluation model according to factors such as the complexity of the passenger sequence and the number of obstructions between vehicles, and the difficulty is controlled within the expected range by adjusting the generation parameters. The evaluation model can be a deep neural network, which inputs the parameters of the game level into the deep neural network, predicts the difficulty of the level according to the trained weights and activation functions, outputs the predicted difficulty value, and classifies the level into different difficulty levels according to the output difficulty value. For example: if the difficulty value is between 0 and 0.3, the corresponding level difficulty is classified as the primary 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 the passengers randomly drawn from the node with the highest priority. For example, in the first scheme, it is assumed that each time a passenger is drawn, all the people in the car are taken away at once to make it empty; in the second scheme, it is completely random and irregular; under the same conditions, the difficulty of the level generated by the second scheme will be higher than that of the first scheme, because the fluency of the car picking up people during the player's game will be reduced under the second scheme, the probability of the parking space being occupied will also increase, and the fault tolerance will be reduced. The lower the level of level difficulty, the simpler the way to draw the passenger sequence. The complexity of the sequence is a dimension of level difficulty, which affects the fluency of the player's game process.

[0175] In some embodiments, after generating the game level, the winning rate of the players is counted, and the winning rate is used as the dependent variable. The linear combination of the level difficulty parameters is used as the independent variable for curve fitting. The best fitting scheme is selected to map the parameters and difficulty, and the mapping relationship is used as the basis for difficulty adjustment and judgment.

[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, which is achieved by real-time detection of directed graphs. For example, when the level planner designs the vehicle placement, it may cause an incorrect 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. According to the situation of the loop, the vehicle nodes in the loop are deleted or adjusted 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 positional relationship between vehicles and vehicles, 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 identified first. The nodes correspond to different vehicles. Each node has the color and passenger attributes of the vehicle. Priorities are established according to the out-degree of the nodes. Passengers are randomly selected from the nodes with the highest priority, and the node attributes in the directed graph are updated in time to generate a passenger sequence, saving the time and design costs of level development. When the player uses props to change the color of the vehicle or the passenger sequence, a certain number of passengers of the same color are added to the sequence in order, 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 is always solvable. Through the combination of directed graphs and sequence structures, the dynamic generation of game levels is realized, reducing errors caused by human factors. During the level generation and adjustment process, an exception is prompted that there is no solution to ensure the solvability of the level generation. Based on the vehicle relationship graph and passenger sequence with solvable strategies, the corresponding game levels are generated, and the game levels before the use of props are updated. The generation parameters used in the process of generating the game levels are consistent with the generation parameters before 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 is a description of an 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, 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 provided, 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 a plurality of virtual vehicles and the first virtual object sequence, and the first level is loaded in the virtual scene; a level update module 4552 is used to sample a plurality of second seats from a plurality of virtual vehicles in the first directed graph according to an ascending sequence of out-degree parameters when the first virtual object sequence is modified, and generate a second virtual object sequence matching the plurality of second seats; a second level is generated based on the properties of the plurality of 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 respectively; 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 also 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; 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 used to sample the free seats in the virtual vehicle according to the ascending sequence of the out-degree parameter 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 the sampling order to obtain a second virtual object sequence that matches the multiple 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 parameters of each virtual vehicle in the second directed graph; sampling the modified virtual vehicle according to the ascending sequence of the out-degree parameters 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 using 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 number of element values ​​in the matrix row as the preset value as the out-degree parameter 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 paths in the second directed graph; when traversing to a closed path that 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 modify the properties of the virtual vehicles with incorrect positional relationships in the second directed graph.

[0188] The embodiment of the present application provides a computer program product, which includes a computer program or a computer executable instruction, and the computer program or the computer executable instruction is stored in a computer-readable storage medium. The processor of the electronic device reads the computer executable instruction from the computer-readable storage medium, and the processor executes the computer executable instruction, so that the electronic device executes the interactive processing method of the virtual scene described in the embodiment of the present application.

[0189] The present application embodiment 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 question-and-answer data processing method provided by the present application embodiment, 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 coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0193] As an 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 at multiple sites and interconnected by a communication network.

[0194] In summary, through the embodiment 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 according to the ascending sequence of the out-degree parameters of each virtual vehicle in the first directed graph to generate a first virtual object sequence, and a first level is generated based on the attributes of 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 generating the level is improved, and the computing resources of the server are saved. In the case where the attributes of the first virtual object sequence or the virtual vehicle are modified, the solvability of the level is maintained and the difficulty before and after the level modification is kept controllable by controlling the generation parameters of the directed graph and the virtual object sequence during the level update process through the same sampling method as the first level.

[0195] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A method for interactive processing of a virtual scene, characterized in that: The method comprises: 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 directed edges between the nodes represent positional relationships between the virtual vehicles; Determine an out-degree parameter of each of the virtual vehicles in the first directed graph, wherein the out-degree parameter represents the number of edges with the virtual vehicle as a node; According to the ascending sequence of the out-degree parameters, the plurality of virtual vehicles are sampled to obtain a plurality of first seats, and a first virtual object sequence is generated 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 the case where the first virtual object sequence is modified, sampling a plurality of second seats from the plurality of virtual vehicles of 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 The 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 transfer relationship of the directed edges, the repeated directed edges in the position relationship graph are removed, and the position relationship graph after the removal is obtained as the first directed graph.

3. The method according to claim 1, characterized in that: The determining of the out-degree parameter of each virtual vehicle in the first directed graph includes: Taking the number of nodes of the virtual vehicle in the first directed graph as the number of rows and the number of columns, initializing a first out-degree matrix that conforms to the number of rows and the number of columns, wherein the initial value of each element in the row where each node in the first out-degree matrix is ​​located is zero; According to the nodes constituting the directed edges in the first directed graph, updating the element value of each element in the first out-degree matrix, wherein the element value of 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, characterized in that: 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 free 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 matching 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 according to 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 a plurality of the virtual vehicles of 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: According to the ascending sequence of the out-degree parameters, sampling the free seats in the virtual vehicle 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 free seats for each of the virtual vehicles in the first directed graph according to 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 attributes of the remaining virtual vehicle after the removal; The first directed graph is modified according to the updated remaining properties 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 of the virtual vehicles in the second directed graph; According to the ascending sequence of the out-degree parameter of each virtual vehicle in the second directed graph, sampling the modified virtual vehicle to obtain a plurality of third seats; 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 The step of 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 comprises: Evaluate the properties of the virtual vehicle before modification and the first virtual object sequence before modification to determine interaction parameters of the first level; 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; Taking the number of nodes of the virtual vehicle in the second directed graph as the number of rows and columns, initializing a second out-degree matrix that conforms to the number of rows and the number of columns, wherein the initial value of each element in the row where each node in the second out-degree matrix is ​​located is zero; According to the nodes constituting the directed edges in the second directed graph, updating the element value of each element in the second out-degree matrix, wherein the element value of 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 a second directed graph based on the modified attributes of the virtual vehicle, the method further includes: Traversing the paths in the second directed graph; In the case where a closed path is found and the closed path does not contain repeated directed edges and nodes, abnormal prompt information is generated, wherein the abnormal prompt information is used to prompt that there is an error in the positional relationship between the virtual vehicles in the second directed graph; Modify the properties 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, 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 the directed edges between the nodes represent the positional relationship between the virtual vehicles; 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; sample the plurality of virtual vehicles in ascending order of the out-degree parameters to obtain a plurality of first seats, and 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 in the virtual scene; A level updating module is used to sample 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 to generate a second virtual object sequence matching the plurality of second seats when the first virtual object sequence is modified; generate a second level based on the 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

  • Scene data processing method and virtual resource putting method and device

    CN116764227A

  • Determining action selection policies of an execution device

    US10765949B1

Cited By

  • Virtual scene level generation method and device, electronic equipment, computer readable storage medium and computer program product

    CN120860601A