Virtual scene interaction method and device
By querying mapping relationships in the virtual scene to determine the motion information and operation results of virtual props, the problems of low virtual scene design efficiency and waste of computing resources are solved, and the precise control of operation results and the performance improvement of virtual scenes are achieved.
Patent Information
- Application Number
- CN202510146095.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-10
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-02-10
AI Technical Summary
The prior art requires repeated adjustments to the layout and launch of virtual scenes when designing virtual scenes, resulting in inefficient design and waste of computing resources, making it difficult to accurately control the operation results.
By generating the desired operation results and obtaining the motion information of the virtual props, querying multiple mapping relationships based on this information, determining the target candidate motion information and operation results, and controlling the virtual props to be emitted according to the target mapping relationship, so as to achieve precise control of the operation results.
It improves the design efficiency and computing resource utilization of virtual scenes, realizes precise control of operation results and rationality of distribution, and improves the stability, fluency and authenticity of virtual scenes.
Smart Images

Figure CN120053958A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to an interaction method and device for a virtual scene. Background Art
[0002] With the development of computer technology, electronic devices can implement more abundant and vivid virtual scenes. A virtual scene refers to a digital scene outlined by a computer through digital communication technology, and users can interact with various virtual props in the virtual scene to obtain feedback.
[0003] Taking the example of a player launching a virtual prop in a virtual scene and obtaining an operation result (such as a game score, game revenue, etc.), in the related art, according to the obstacle layout (such as position, density) of the virtual scene and the launch situation of the virtual prop (such as launch angle, launch direction, etc.), the obtained operation result is determined. However, this method 1) requires repeated, precise and meticulous adjustment of the layout of the virtual scene (such as the position and density of obstacles) and the launch situation during the design of the virtual scene, relying on a large amount of manual testing and adjustment, resulting in low design efficiency of the virtual scene and difficulty in precisely controlling the desired operation result; 2) has a large amount of real-time calculation during launch, resulting in waste of computing resources. Summary of the Invention
[0004] Embodiments of this application provide an interaction method, device, electronic device, computer-readable storage medium, and computer program product for a virtual scene, which can achieve precise control of operation results in the virtual scene, reduce the occupation of computing resources, and improve the design efficiency of the virtual scene.
[0005] The technical solution of the embodiments of this application is implemented as follows:
[0006] Embodiments of this application provide an interaction method for a virtual scene, including:
[0007] In response to a launch operation on a virtual prop in the virtual scene, generating an expected operation result of the launch operation, and obtaining the motion information of the virtual prop indicated by the launch operation;
[0008] Obtaining a plurality of mapping relationships, where the mapping relationship is a mapping relationship between candidate motion information and candidate operation results;
[0009] Querying the plurality of mapping relationships based on the motion information and the expected operation result;
[0010] When a target mapping relationship is queried from the plurality of mapping relationships, controlling the virtual prop to be launched according to the target candidate motion information in the target mapping relationship, and controlling the operation result of the launch operation to be the target candidate operation result in the target mapping relationship;
[0011] Among them, the difference between the target candidate motion information and the motion information satisfies a first difference condition, and the difference between the target candidate operation result and the desired operation result satisfies a second difference condition.
[0012] An embodiment of the present application further provides an interaction device for a virtual scene, including:
[0013] A generation module, configured to generate a desired operation result of the launch operation in response to a launch operation on a virtual prop in the virtual scene, and obtain the motion information of the virtual prop indicated by the launch operation;
[0014] An acquisition module, configured to acquire a plurality of mapping relationships, where the mapping relationships are mapping relationships between candidate motion information and candidate operation results;
[0015] A query module, configured to query the plurality of mapping relationships based on the motion information and the desired operation result;
[0016] A control module, configured to, when a target mapping relationship is queried from the plurality of mapping relationships, control the virtual prop to be launched according to the target candidate motion information in the target mapping relationship, and control the operation result of the launch operation to be the target candidate operation result in the target mapping relationship;
[0017] Among them, the difference between the target candidate motion information and the motion information satisfies a first difference condition, and the difference between the target candidate operation result and the desired operation result satisfies a second difference condition.
[0018] An embodiment of the present application further provides an electronic device, including:
[0019] A memory, configured to store computer-executable instructions;
[0020] A processor, configured to implement the interaction method for a virtual scene provided by an embodiment of the present application when executing the computer-executable instructions stored in the memory.
[0021] An embodiment of the present application further provides a computer-readable storage medium, storing computer-executable instructions or a computer program, where when the computer-executable instructions or the computer program are executed by a processor, the interaction method for a virtual scene provided by an embodiment of the present application is implemented.
[0022] An embodiment of the present application further provides a computer program product, including computer-executable instructions or a computer program, where when the computer-executable instructions or the computer program are executed by a processor, the interaction method for a virtual scene provided by an embodiment of the present application is implemented.
[0023] The embodiments of the present application have the following beneficial effects:
[0024] Applying the above embodiments of the present application, when a launch operation for a virtual prop in a virtual scene is received, first generate an expected operation result of the launch operation, and obtain the motion information of the virtual prop indicated by the launch operation. Then, based on the motion information and the expected operation result, query multiple mapping relationships. When a target mapping relationship is queried from the multiple mapping relationships, control the virtual prop to be launched according to the target candidate motion information in the target mapping relationship, and control the operation result of the launch operation to be the target candidate operation result in the target mapping relationship; wherein, the difference between the target candidate motion information and the motion information satisfies the first difference condition, and the difference between the target candidate operation result and the expected operation result satisfies the second difference condition.
[0025] In this way, by querying the mapping relationship based on the motion information and the expected operation result, the motion information required to launch the virtual prop and the operation result that can be obtained by launching the virtual prop can be determined. Therefore, 1) without considering the layout of the virtual scene, the operation result can be quickly determined, reducing the occupation of computing resources, improving the performance of the computing device, and thus improving the stability, fluency, and authenticity of the virtual scene; 2) only based on the mapping relationship to determine the operation result, precise control of the operation result of launching the virtual prop can be achieved, so that the distribution of the operation result can be controlled more reasonably, maintaining the balance of the operation result of the virtual scene, and improving the experience of the virtual scene; 3) since the operation result can be quickly determined without relying on the layout of the virtual scene, when designing the virtual scene, the designer does not need to repeatedly adjust the layout of the virtual scene, improving the design efficiency of the virtual scene and the scalability of the virtual scene, and being able to adapt to the design requirements of rapidly changing virtual scenes. Description of the Drawings
[0026] Figure 1 is a schematic diagram of the architecture of the interaction system of the virtual scene provided by the embodiments of the present application;
[0027] Figure 2 is a schematic diagram of the structure of the electronic device provided by the embodiments of the present application;
[0028] Figure 3 is a schematic flowchart of the interaction method of the virtual scene provided by the embodiments of the present application;
[0029] Figure 4 is a schematic flowchart of the interaction method of the virtual scene provided by the embodiments of the present application;
[0030] Figure 5 is a schematic flowchart of the interaction method of the virtual scene provided by the embodiments of the present application;
[0031] Figure 6 is a schematic flowchart of the interaction method of the virtual scene provided by the embodiments of the present application;
[0032] Figure 7 It is a schematic diagram of the interface of the virtual scenario provided by the embodiments of the present application. Detailed implementation manners
[0033] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be construed as limitations on the present application. All other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present application.
[0034] In the following descriptions, reference is made to "some embodiments", which describe subsets of all possible embodiments. However, it can be understood that "some embodiments" can be the same subsets or different subsets of all possible embodiments and can be combined with each other without conflict.
[0035] In the following descriptions, the terms "first / second / third" are only used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first / second / third" can be interchanged with a specific order or sequence when allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0036] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), 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 a part of an overall module or unit that includes the functions of the module or unit.
[0037] 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 to which the present application belongs. 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.
[0038] In the embodiments of the present application, the collection and processing of relevant data should strictly comply with the requirements of relevant laws and regulations when applied in actual cases, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing behaviors within the scope authorized by laws and regulations and the personal information subject.
[0039] Before further elaborating on the embodiments of the present application, 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 explanations.
[0040] 1) Client, an application program running in an electronic device for providing various services, such as a client supporting a virtual scenario (such as a game scenario).
[0041] 2) In response to, used to represent the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more of the executed operations can be real-time or have a set delay; without special instructions, there is no restriction on the execution order of multiple executed operations.
[0042] 3) Virtual scenario, a virtual scenario displayed (or provided) when a computer program runs on a terminal. The virtual scenario can be a simulation environment of the real world, a semi-simulated and semi-fictional virtual environment, or a purely fictional virtual environment. The virtual scenario can be any one of a two-dimensional virtual scenario, a 2.5D virtual scenario, or a three-dimensional virtual scenario. In the embodiments of the present application, the virtual scenario can support a player character to launch virtual props. For example, the virtual prop can be a virtual marble, a virtual bow and arrow, a virtual bullet, etc. that can be launched (or thrown); the virtual scenario can also include obstacles, such as a catapult obstacle that can catapult virtual marbles, a target for virtual bow and arrows or virtual bullets, an obstacle that can be penetrated by virtual bow and arrows or virtual bullets, etc. Therefore, the virtual scenario can support players to experience the marble-playing method. For example, a player launches a virtual marble, and the virtual marble bounces repeatedly among various catapult obstacles and finally bounces into the set marble interface to obtain the operation result of launching the virtual marble (such as the score, reward, etc. obtained according to the bouncing situation); the virtual scenario can also support players to experience the shooting method. For example, a player launches a virtual bullet, and the virtual bullet hits the target after being launched to obtain the operation result of launching the virtual bullet (such as the score obtained according to the position where the target is hit); the virtual scenario can also support players to experience the shooting method. For example, a player launches a virtual bow and arrow, and the virtual bow and arrow penetrates the obstacles in sequence after being launched to obtain the operation result of launching the virtual bow and arrow (such as the score obtained according to the number of penetrated obstacles); and so on.
[0043] The embodiments of the present application provide an interaction method, device, electronic device, computer-readable storage medium, and computer program product for a virtual scenario, which can achieve precise control of operation results in the virtual scenario, reduce the occupation of computing resources, and improve the design efficiency of the virtual scenario. Next, based on the above description of the nouns and terms involved in the embodiments of the present application, the embodiments of the present application will be described in detail.
[0044] The following describes the interaction system for a virtual scenario provided by the embodiments of the present application. See Figure 1 , Figure 1It is a schematic architecture diagram of an interaction system for a virtual scene provided by an embodiment of the present application. To support an exemplary application, the interaction system 100 of the virtual scene includes: a server 200, a network 300, and a terminal 400. Among them, the terminal 400 is connected to the server 200 through the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two, and uses wireless or wired links to achieve data transmission.
[0045] Here, the terminal 400 (for example, running a client that supports a virtual scene (such as a game scene)) is used to generate an expected operation result of the launch operation in response to a launch operation on a virtual item in the virtual scene, and obtain the motion information of the virtual item indicated by the launch operation; send an operation result acquisition request to the server 200, and the operation result acquisition request is used to obtain the operation result of the launch operation. The operation result acquisition request includes motion information and an expected operation result; the server 200 is used to receive the operation result acquisition request; parse the operation result acquisition request to obtain the motion information and the expected operation result; obtain multiple mapping relationships, and the mapping relationship is a mapping relationship between candidate motion information and candidate operation results; query multiple mapping relationships based on the motion information and the expected operation result; when a target mapping relationship is queried from the multiple mapping relationships, return the target candidate motion information and the target candidate operation result in the target mapping relationship to the terminal 400; among them, the difference between the target candidate motion information and the motion information satisfies the first difference condition, and the difference between the target candidate operation result and the expected operation result satisfies the second difference condition; the terminal 400 receives the target candidate motion information and the target candidate operation result returned by the server 200; controls the virtual item to be launched according to the target candidate motion information, and controls the operation result of the launch operation to be the target candidate operation result.
[0046] The interactive method for virtual scenarios provided by the embodiments of this application is implemented by an electronic device. For example, it can be implemented by a terminal alone, by a server alone, or by the cooperation of a terminal and a server. The electronic device for implementing the interactive method for virtual scenarios provided by the embodiments of this application can be various types of terminals or servers. Among them, the server (such as server 200) can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms. The terminal (such as terminal 400) can be a laptop computer, a tablet computer, a desktop computer, a smart phone, a smart voice interaction device (such as a smart speaker), a smart home appliance (such as a smart TV), a smart watch, a vehicle-mounted terminal, a wearable device, a Virtual Reality (VR) device, an aircraft, etc., but is not limited thereto. The terminal and the server can be directly or indirectly connected through wired or wireless communication methods, and the embodiments of this application do not limit this.
[0047] In some embodiments, the terminal or the server can implement the interactive method for virtual scenarios provided by the embodiments of this application by running various computer-executable instructions or computer programs. For example, the computer-executable instructions can be commands at the microprogram level, machine instructions, or software instructions. The computer program can be a native program or a software module in an operating system; it can be a local (Native) application (Application, APP), that is, a program that needs to be installed in the operating system to run, such as a game APP; it can also be a small program that can be embedded in any APP, that is, a program that only needs to be downloaded to the browser environment to run. In short, the above-mentioned computer-executable instructions can be instructions in any form, and the above-mentioned computer programs can be application programs, modules, or plugins in any form.
[0048] The following describes the electronic device for implementing the interactive method for virtual scenarios provided by the embodiments of this application. Refer to Figure 2 , Figure 2 is the structural schematic diagram of the electronic device provided by the embodiments of this application. The electronic device 500 provided by the embodiments of this application can be a terminal or a server. As Figure 2As shown, the electronic device 500 includes: at least one processor 510, a memory 550, at least one network interface 520 and a user interface 530. The various components in the electronic device 500 are coupled together through a bus system 540. It can be understood that the bus system 540 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 540 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 540 is not used in the following examples. Figure 2 Various buses are labeled as bus system 540 .
[0049] The processor 510 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.
[0050] The user interface 530 includes one or more output devices 531 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 530 also includes one or more input devices 532, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0051] The memory 550 may be removable, non-removable, or a combination thereof. The memory 550 may include one or more storage devices physically located away from the processor 510. The memory 550 includes a volatile memory or a non-volatile memory, and may also include both a volatile memory and a non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 550 described in the embodiments of the present application is intended to include any suitable type of memory.
[0052] In some embodiments, the memory 550 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.
[0053] Operating system 551, including system programs for processing various basic system services and performing hardware-related tasks, such as framework layer, core library layer, driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0054] A network communication module 552 is configured to reach other electronic devices via one or more (wired or wireless) network interfaces 520. Exemplary network interfaces 520 include: Bluetooth, Wireless Fidelity (WiFi), Universal Serial Bus (USB), etc.
[0055] A presentation module 553 is configured to enable the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 531 associated with the user interface 530 (such as a display screen, a speaker, etc.).
[0056] An input processing module 554 is configured to detect one or more user inputs or interactions from one of one or more input devices 532 and translate the detected inputs or interactions.
[0057] In some embodiments, the interaction device for a virtual scene provided by the embodiments of the present application may be implemented in software. Figure 2 Shown is an interaction device 555 for a virtual scene stored in a memory 550, which may be software in the form of a program, a plugin, etc., and includes the following software modules: a generation module 5551, an acquisition module 5552, a query module 5553, and a control module 5554. These modules are logical, and thus can be combined arbitrarily or further split according to the functions to be implemented. The functions of each module will be described hereinafter.
[0058] The following describes the interaction method for a virtual scene provided by the embodiments of the present application. As described above, the interaction method for a virtual scene provided by the embodiments of the present application is implemented by an electronic device, for example, it can be implemented independently by a server or a terminal, or jointly implemented by a server and a terminal. Therefore, the execution subject of each step will not be repeated hereinafter. Refer to Figure 3 , Figure 3 which is a schematic flowchart of the interaction method for a virtual scene provided by the embodiments of the present application. The interaction method for a virtual scene provided by the embodiments of the present application includes:
[0059] Step 101: In response to a launch operation on a virtual prop in a virtual scene, generate a desired operation result of the launch operation and obtain the motion information of the virtual prop indicated by the launch operation.
[0060] In the embodiments of the present application, the virtual scene can support a player character to launch virtual props. For example, the virtual props can be virtual marbles, virtual bows and arrows, virtual bullets, virtual balls, etc., which are props that can be launched (or thrown); the virtual scene can also include obstacles, such as elastic obstacles that can bounce virtual marbles, targets for virtual bows and arrows or virtual bullets, obstacles that can be penetrated by virtual bows and arrows or virtual bullets, etc. Therefore, the virtual scene can support players to experience the marble-playing method. For example, the player launches a virtual marble, and the virtual marble bounces repeatedly among various elastic obstacles and finally bounces into the set marble interface to obtain the operation result of launching the virtual marble (such as scores, rewards, etc. obtained according to the bouncing situation); the virtual scene can also support players to experience the shooting method. For example, the player launches a virtual bullet, and the virtual bullet hits the target after being launched to obtain the operation result of launching the virtual bullet (such as scores obtained according to the position where the target is hit); the virtual scene can also support players to experience the shooting method. For example, the player launches a virtual bow and arrow, and the virtual bow and arrow penetrates the obstacles in sequence after being launched to obtain the operation result of launching the virtual bow and arrow (such as scores obtained according to the number of penetrated obstacles); etc. It should be noted that different playing methods of the virtual scene (such as the position and quantity of obstacles, the relationship between obstacles and operation results) can be set according to different virtual props, which will not be limited here.
[0061] For step 101, the player can trigger the launch operation for a virtual prop (such as a virtual marble). The electronic device (such as a terminal) responds to the launch operation and generates the expected operation result of the launch operation. For example, a random number can be generated through a random number generation algorithm and used as the expected operation result. At the same time, obtain the motion information of the virtual prop indicated by the launch operation. The motion information is the initial motion information of the virtual prop when it is launched. For example, the motion information can include the initial velocity, the magnitude of the initial force, the initial motion direction, the initial acceleration, etc.
[0062] In some embodiments, the candidate operation results in multiple mapping relationships conform to the target distribution; based on this, see Figure 4 , the expected operation result of the launch operation can be generated by performing the following steps 201-step 204: Step 201, obtain the target kernel function and the bandwidth parameter; Step 202, perform kernel density estimation on the candidate operation results in multiple mapping relationships based on the target kernel function and the bandwidth parameter to obtain the probability density function; Step 203, convert the probability density function to obtain the target function that conforms to the target distribution; Step 204, generate the expected operation result of the launch operation based on the target function.
[0063] Here, the multiple mapping relationships are pre-constructed. The mapping relationship is the mapping relationship between the candidate motion information and the candidate operation result, that is, each candidate motion information has a corresponding candidate operation result. It should be noted that the candidate motion information is for the launching operation of the virtual prop, and the candidate operation result is the operation result of the launching operation. When the virtual prop is launched with the candidate motion information, the obtained operation result is the candidate operation result that has a mapping relationship with the candidate motion information. The candidate motion information is similar to the above-mentioned motion information and can also include the initial velocity, the magnitude of the initial force, the initial motion direction, the initial acceleration, and so on. The multiple candidate operation results included in the multiple mapping relationships conform to the target distribution. By way of example, the target distribution can be a normal distribution, which is not limited in this embodiment.
[0064] Since the candidate operation results in the multiple mapping relationships conform to the target distribution, based on this, the expected operation result of the launching operation can be generated in the following manner: For step 201, obtain the target kernel function and the bandwidth parameter. When generating the expected operation result, first construct the probability density function through kernel density estimation. Therefore, in step 201, the kernel density estimation parameters for constructing the probability density function need to be obtained. The kernel density estimation parameters include the target kernel function for kernel density estimation and the bandwidth parameter h. In practical applications, different target kernel functions can be selected to smooth the data. By way of example, the target kernel function can be the Gaussian Kernel, and the bandwidth parameter h can be set manually (such as according to empirical values) or automatically (such as automatically selecting the optimal value using the cross-validation method). It should be noted that the bandwidth parameter h is a key parameter in kernel density estimation, which controls the width of the target kernel function, that is, the degree of smoothing. If the value of h is too small, the estimated probability density function will be too complex and overfitting will occur; if the value of h is too large, the estimated function will be too smooth and detailed information will be lost.
[0065] For step 202, first extract the multiple candidate operation results included in the multiple mapping relationships, and then perform kernel density estimation on the candidate operation results in the multiple mapping relationships based on the target kernel function and the bandwidth parameter to obtain the probability density function. Here, the target kernel function and the bandwidth parameter are used to smooth the multiple candidate operation results, thereby estimating the probability density function of the multiple candidate operation results. The probability density function can reflect the distribution of the multiple candidate operation results near different values. Specifically, kernel density estimation estimates the probability density function of the multiple candidate operation results by using the target kernel function for each candidate operation result and summing up the contributions of these target kernel functions.
[0066] For step 203, the probability density function is transformed to obtain an objective function that conforms to the target distribution. The transformation process may include normalization and scale transformation. That is, first, the probability density function is normalized to obtain a standard density function, and then the standard density function is subjected to a scale transformation to obtain an objective function that conforms to the target distribution. In some embodiments, the above step 203, "transform the probability density function to obtain an objective function that conforms to the target distribution", can be implemented by performing the following steps: obtain the standard parameters for normalization processing, and based on the standard parameters, perform normalization processing on the probability density function to obtain a standard density function; obtain the required parameters of the target distribution, and based on the required parameters, perform scale transformation processing on the standard density function to obtain an objective function that conforms to the target distribution.
[0067] Here, when performing normalization processing, the standard parameters for normalization processing can be used first, so that based on the standard parameters, the probability density function is normalized to obtain a standard density function. In practical applications, since the probability density function describes the distribution of multiple candidate operation results, it is first necessary to check the distribution characteristics of the multiple candidate operation results. If it is determined that the multiple candidate operation results are approximately uniformly distributed within a set interval, then the probability density function is normalized. Subsequently, the standard parameters can be pre-set. For example, the normalization parameter can have a mean of 0 and a variance of 1. Based on this normalization parameter, normalizing the probability density function will result in a standard density function with a mean of 0 and a variance of 1.
[0068] Next, to make the standard density function conform to the required target distribution (such as a normal distribution), scale transformation processing needs to be performed on the standard density function. When performing scale transformation processing, first, the required parameters of the target distribution are obtained. For example, when the target distribution is a normal distribution, the required parameters of the normal distribution include: the mean and the standard deviation, and the mean and the standard deviation can be set according to requirements. For example, when the target distribution is a standard normal distribution, the mean included in the required parameters is 0, and the standard deviation is 1. After obtaining the required parameters, the scale transformation coefficient can be determined according to the required parameters. The scale transformation coefficient can make the mean and the standard deviation of the objective function after scale transformation conform to the required parameters. The scale transformation coefficient can be the reciprocal of the standard deviation of the normal distribution. For example, if the required parameters include a mean of 0 and a standard deviation of 1, then the scale transformation coefficient can be the reciprocal of the standard deviation of the standard normal distribution. Finally, the standard density function is subjected to scale transformation processing according to the scale transformation coefficient to obtain an objective function that conforms to the target distribution. In this way, the probability density function obtained by kernel density estimation is adjusted to a target distribution (such as a normal distribution) that conforms to specific parameters (i.e., the above required parameters).
[0069] For step 204, based on the objective function, the expected operation result of the emission operation is generated. In some embodiments, refer toFigure 5 For step 204 “generating an expected operation result of the emission operation based on the objective function” above, it can be implemented by performing the following steps 2041 - 2043: Step 2041, determining the inverse function of the cumulative distribution function of the objective function; Step 2042, generating a first random number conforming to a uniform distribution; Step 2043, calling the inverse function to process the first random number to obtain a second random number sampled from the target distribution, and using the second random number as the expected operation result of the emission operation.
[0070] Here, for step 2041, first determine the cumulative distribution function of the objective function, and then determine the inverse function of the cumulative distribution function. For step 2042, a set of first random numbers conforming to a uniform distribution need to be generated. These first random numbers are usually within the interval [0, 1), and the first random numbers can be generated by a pre - set random number generator. For step 2043, first randomly sample a target first random number from the first random numbers conforming to a uniform distribution, and then call the inverse function of the cumulative distribution function of the objective function to process the target first random number to obtain a second random number sampled from the target distribution. Specifically, the target first random number can be input into the inverse function, and the inverse function performs a function calculation on the target first random number to obtain the second random number. This second random number can be considered as randomly drawn from the target distribution (i.e., random numbers conforming to the target distribution). Finally, use the second random number as the expected operation result of the emission operation.
[0071] Step 102: Obtain multiple mapping relationships.
[0072] Among them, the mapping relationship is the mapping relationship between candidate motion information and candidate operation results.
[0073] For step 102, obtain multiple mapping relationships. These multiple mapping relationships are pre - constructed. The mapping relationship is the mapping relationship between candidate motion information and candidate operation results, that is, each piece of candidate motion information has a corresponding candidate operation result. It should be noted that the candidate motion information is for the emission operation of the virtual prop, and the candidate operation result is the operation result of this emission operation. When the virtual prop is emitted with this candidate motion information, the obtained operation result is the candidate operation result that has a mapping relationship with this candidate motion information. The candidate motion information is similar to the above - mentioned motion information and can also include initial velocity, initial force magnitude, initial motion direction, initial acceleration, etc.
[0074] In some embodiments, refer to Figure 6, the above mapping relationship can be constructed by performing the following steps 301 - 305: Step 301, obtain multiple simulated motion information of the virtual prop; Step 302, for each simulated motion information, simulate the virtual prop being launched according to the simulated motion information, and simulate the launched virtual prop moving in the virtual scene; Step 303, for each simulated motion information, when the virtual prop launched based on the simulated motion information stops moving, determine the simulated operation result corresponding to the simulated motion information based on the simulated motion data of the virtual prop in the virtual scene; Step 304, collect the target simulated operation results that conform to the target distribution from the multiple simulated operation results, and collect the target simulated motion information corresponding to the target simulated operation results from the multiple simulated motion information; Step 305, for each target simulated motion information, use the target simulated motion information as the candidate motion information, use the target simulated operation result corresponding to the target simulated motion information as the candidate operation result, and construct the mapping relationship between the candidate motion information and the candidate operation result.
[0075] Here, the motion situation of the virtual prop in the virtual scene (including the launch, motion, and operation results obtained after stopping the motion of the virtual prop, etc.) can be simulated multiple times, where the number of simulations can be set according to requirements. Based on this, for Step 301, obtain multiple simulated motion information of the virtual prop during the simulation process. This simulated motion information is the motion information of the virtual prop generated by the above multiple simulation behaviors, and this simulated motion information can include, but is not limited to, the initial velocity, the magnitude of the initial force, the initial motion direction, the initial acceleration, etc. For Step 302, for each simulated motion information, simulate the motion process of the virtual prop in the virtual scene based on this simulated motion information, that is: simulate the virtual prop being launched according to the simulated motion information, and simulate the launched virtual prop moving in the virtual scene.
[0076] For Step 303, for each simulated motion information, when the virtual prop launched based on the simulated motion information stops moving, obtain the simulated motion data of the virtual prop in the virtual scene. For example, taking the virtual prop as a virtual marble, the player launches the virtual marble, and the virtual marble bounces repeatedly among various bouncing obstacles and finally bounces into the set marble interface to obtain the operation result of launching the virtual marble. Then this simulated motion data can include the bouncing obstacles contacted by the virtual marble, the bouncing magnification of each bouncing obstacle, the finally entered marble interface, etc. Thus, based on the simulated motion data of the virtual prop in the virtual scene, determine the simulated operation result corresponding to the simulated motion information. Continuing with the above example, for example, corresponding bouncing magnifications can be set for each bouncing obstacle, and a corresponding final magnification can be set for the marble interface. Based on this, the bouncing magnifications of all the bouncing obstacles contacted by the virtual marble can be multiplied to obtain the first result, and then the first result can be multiplied by the final magnification of the marble interface to obtain the simulated operation result.
[0077] For step 304, after obtaining multiple simulation operation results, from the multiple simulation operation results, collect the target simulation operation results that conform to the target distribution, and the target distribution can be set according to requirements, such as a normal distribution; at the same time, from the multiple simulation motion information, collect the target simulation motion information corresponding to the target simulation operation results. For step 305, for each target simulation motion information, use the target simulation motion information as the candidate motion information, and use the target simulation operation result corresponding to the target simulation motion information as the candidate operation result, so as to construct a mapping relationship between the candidate motion information and the candidate operation result. In this way, multiple mapping relationships are obtained.
[0078] In some embodiments, the "collecting the target simulation operation results that conform to the target distribution from the multiple simulation operation results" in the above step 304 can be implemented by performing the following steps: obtaining the distribution parameters of the target distribution, and based on the distribution parameters, determining the operation result interval; from the multiple simulation operation results, collecting multiple target simulation operation results that are within the operation result interval and conform to the target distribution; the "collecting the target simulation motion information corresponding to the target simulation operation results from the multiple simulation motion information" in the above step 304 can be implemented by performing the following steps: for each target simulation operation result, from the multiple simulation motion information, collecting the target number of target simulation motion information corresponding to the target simulation operation result.
[0079] Here, step 304 can be implemented based on the following method: first, obtain the distribution parameters of the target distribution, and the distribution parameters can include the mean and standard deviation of the target distribution, and the target distribution can be a normal distribution; then, according to the distribution parameters, determine the operation result interval, and the operation result interval is the interval where the target simulation operation results are located. Thus, from the multiple simulation operation results, collect multiple target simulation operation results that are within the operation result interval and conform to the target distribution. Based on this, step 305 can be implemented based on the following method: for each target simulation operation result, perform the following processing respectively: from the multiple simulation motion information, collect the target number of target simulation motion information corresponding to the target simulation operation result. It should be noted that the target number is not less than the preset number, and the distribution density of the target simulation motion information within the motion information interval is not less than the preset density.
[0080] In some embodiments, the virtual scene includes at least one virtual obstacle and at least one virtual interface for virtual props; after controlling the virtual prop to be launched according to the target candidate motion information in the target mapping relationship, the following steps may further be executed: controlling the virtual prop to move between at least one virtual obstacle; based on the movement of the virtual prop between at least one virtual obstacle, controlling the virtual prop to enter the target virtual interface among at least one virtual interface; correspondingly, the following steps may also be executed: displaying the target candidate operation result. It should be noted that controlling the virtual prop to move between at least one virtual obstacle may be implemented through physical simulation by a physics engine, and the target virtual interface entered is also determined based on the movement situation obtained from the physical simulation.
[0081] Next, taking the virtual prop as a virtual marble, the target distribution as a normal distribution, and the motion information as the initial velocity as an example, the embodiments of the present application will be described in detail. Refer to Figure 7 , Figure 7 which shows an interface diagram of the virtual scene. This virtual scene supports players to experience the marble game play. As a module in the game, players can obtain virtual marbles from other modules of the game and then experience the marble game play in this virtual scene. Specifically, players can launch the virtual marble 71 in a fixed direction with an initial elastic force (corresponding to the initial velocity of the launch). The virtual marble bounces repeatedly among various bouncing obstacles 72 (a "bouncing magnification or score" will be obtained each time of bouncing), and finally the virtual marble falls into the final marble interface 73 (there can be multiple marble interfaces, and each interface corresponds to a different "final score") under the action of virtual gravity, and finally outputs the operation result 74 for the launch operation of this virtual marble (such as a score of 245 points). In practical applications, players can continuously accumulate the income value (i.e., the operation result) to obtain stage rewards and final rewards. After obtaining the final reward, the process of the marble machine module ends.
[0082] First, the process of constructing the mapping relationship will be described based on the above example. In practical applications, a database system can be established through a large number of pre-simulated tests in advance. This database system is used to record the mapping relationship between various candidate initial velocities and candidate operation results (such as the yield rate of launching a virtual marble). Based on this, when a player launches a virtual marble, a random number that conforms to the normal distribution is generated and used as the expected operation result (i.e., the expected yield rate) obtained from launching this virtual marble; then quickly query the database system to obtain the target candidate operation result that is approximate to the expected operation result and the target candidate initial velocity that is close to the initial velocity of the player launching the virtual marble. There is a mapping relationship between the target candidate initial velocity and the target candidate operation result, so as to control the virtual marble to be launched according to the target candidate initial velocity and obtain the target candidate operation result, thereby making the operation result of each launch operation within the range of the expected operation result.
[0083] Among them, the specific process of constructing multiple mapping relationships includes the following steps:
[0084] (1) First, determine the construction of the virtual scenario, including the layout of the ejection obstacles, the ejection magnification brought by each ejection obstacle, and the calculation formula of the final yield rate (as described above, generally the ejection magnifications are added, and the result is multiplied by the final magnification).
[0085] (2) After determining the virtual scenario, conduct a large number of simulated ejections for data collection.
[0086] (a) Each time during the simulation, launch the virtual marble with a candidate initial velocity v. The virtual marble superimposes the ejection magnification during a series of bounces and finally obtains a candidate operation result (i.e., the final yield rate) S. Record the mapping relationship between the candidate initial velocity v and the candidate operation result S. In other words, it can be considered that S is a function of v, and this functional relationship is denoted as f. Through a large number of simulations and data collections, a large number of candidate initial velocities v and their corresponding function values f(v) (i.e., the candidate operation results S) are obtained.
[0087] (b) For all f(v)=S, ideal conditions need to be met. The condition is that the collected v and S need to cover the required interval with a sufficient density. For example, if the expectation of X(t) is 100 and the standard deviation is 20, then according to the 3σ principle, f(v) needs to cover the interval [40, 160], and the density is not lower than the preset density. Among them, the density not being lower than the preset density can be judged by setting indicators. For example, for each integer n in the interval [40, 160], the number of its inverse function values f^{-1}(n) >= p, where p is a certain positive integer (i.e., the above-mentioned preset quantity). That is to say, there are more than p different candidate initial velocities v_n such that f(v_n)=n, and at the same time, these p different candidate initial velocities v_n need to be satisfied as much as possible to "fill" the range interval of the initial velocity as much as possible. This ideal condition generally means that the complete mapping relationship f: [definition interval of candidate initial velocity] -> [definition interval of candidate operation result] is simulated as perfectly as possible, so that for a given candidate operation result S and a random initial velocity v_0, a candidate initial velocity v' can always be found such that |v'-v_0| is as small as possible, and at the same time f(v')=S.
[0088] Due to the existence of the ejection obstacle, a slight change in the initial velocity v may lead to a large difference in the operation result. The more and more complex the obstacles are, the greater this kind of perturbation generally is. Through the embodiments of the present application, it is possible to ensure that the operation results are all within the range of the expected operation results, reduce the dependence on the precise layout of the obstacles, endow the designer with greater creative freedom, improve the overall smoothness and realism of the game, and at the same time reduce the computational complexity and improve the computational efficiency.
[0089] Through a large number of simulations and acquisitions, the mapping relationships (v, f(v)) between many candidate initial velocities and the corresponding candidate operation results are obtained. In this way, multiple mapping relationships are constructed. It should be noted that only all the value pairs (v, f(v)) need to be stored, and there is no need to store the motion curve of the virtual marble. The actual running situation of the virtual marble can be handed over to the game client for real-time processing, thereby reducing the occupation of storage resources.
[0090] Step 103: Query multiple mapping relationships based on the motion information and the expected operation result.
[0091] In step 103, according to the motion information and the expected operation result, multiple mapping relationships are queried. Specifically, the difference between each candidate motion information and the motion information can be calculated, so as to select the first candidate motion information whose difference satisfies the first difference condition from multiple candidate motion information; at the same time, the difference between each candidate operation result and the expected operation result is also calculated, so as to select the first candidate operation result whose difference satisfies the second difference condition from multiple candidate operation results. Subsequently, from the first candidate motion information and the first candidate operation result, the target candidate motion information and the target candidate operation result with a mapping relationship are searched for, that is: there is a mapping relationship between the target candidate motion information and the target candidate operation result, and the target candidate motion information belongs to the first candidate motion information and the target candidate operation result belongs to the first candidate operation result. If the target candidate motion information and the target candidate operation result with a mapping relationship can be found, the mapping relationship between the target candidate motion information and the target candidate operation result is used as the target mapping relationship.
[0092] In some embodiments, based on the motion information and the desired operation result, the following steps can be performed to query multiple mapping relationships: determine the first difference between the candidate motion information and the motion information in each mapping relationship, and determine the second difference between the candidate operation result and the desired operation result in each mapping relationship; screen out the first candidate motion information corresponding to the first difference that meets the first difference condition from the candidate motion information in the multiple mapping relationships; screen out the first candidate operation result corresponding to the second difference that meets the second difference condition and has a mapping relationship with the first candidate motion information from the candidate operation results in the multiple mapping relationships; when the first candidate motion information and the first candidate operation result are screened out, query the target mapping relationship from the mapping relationship formed by the first candidate motion information and the first candidate operation result.
[0093] Here, if there is one mapping relationship formed by the first candidate motion information and the first candidate operation result, then use this one mapping relationship as the target mapping relationship; if there are multiple mapping relationships formed by the first candidate motion information and the first candidate operation result, one mapping relationship can be randomly selected from these multiple mapping relationships as the target mapping relationship.
[0094] Step 104: When the target mapping relationship is queried from the multiple mapping relationships, control the virtual prop to be launched according to the target candidate motion information in the target mapping relationship, and control the operation result of the launch operation to be the target candidate operation result in the target mapping relationship.
[0095] Among them, the difference between the target candidate motion information and the motion information meets the first difference condition, and the difference between the target candidate operation result and the desired operation result meets the second difference condition.
[0096] In step 104, when the target mapping relationship is queried from the multiple mapping relationships, the virtual prop can be controlled to be launched according to the target candidate motion information in the target mapping relationship, and control the operation result of the launch operation to be the target candidate operation result in the target mapping relationship. For example, taking the virtual prop as a virtual marble, in response to the launch instruction for the virtual marble, control the virtual marble to be launched according to the target candidate motion information, and control the virtual marble to bounce repeatedly among various bouncing obstacles, and finally bounce into the set marble interface to obtain the operation result of launching the virtual marble, and this operation result is the target candidate operation result.
[0097] In some embodiments, the first difference condition refers to: the difference between the target candidate motion information and the motion information is lower than the first difference; the second difference condition refers to: the difference between the target candidate operation result and the expected operation result is lower than the second difference. The first difference and the second difference can be preset, and can be fixed values or variable values. Both the first difference and the second difference are values greater than or equal to 0, and the first difference and the second difference can be set as small as possible. For example, both the first difference and the second difference are less than the corresponding difference thresholds.
[0098] In some embodiments, the first difference condition can also refer to: sorting the differences between the candidate motion information and the motion information in ascending order, and selecting the first quantity of candidate motion information with a higher ranking according to the sorting result; the second difference condition can also refer to: sorting the differences between the candidate operation results and the expected operation results in ascending order, and selecting the second quantity of candidate operation results with a higher ranking according to the sorting result.
[0099] It should be noted that there is a mapping relationship between the target candidate motion information and the target candidate operation result determined based on the first difference condition and the second difference condition.
[0100] Thus, 1) By pre - constructing the mapping relationship and then determining the operation result by querying the mapping relationship, the operation result no longer depends entirely on randomness, achieving precise control of the operation result of launching virtual props. Moreover, the operation result conforms to the set target distribution, enabling more reasonable control of the operation result distribution, maintaining the balance and controllability of the operation result in the virtual scene, and enhancing the experience of the virtual scene. 2) Since the dependence on the precise placement of objects (such as virtual obstacles) in the virtual scene is reduced, designers can carry out creative layout design with greater freedom. Whether increasing the number of objects in the virtual scene or adjusting their positions, the expected revenue distribution can be achieved in the game. This flexibility makes the game more adaptable to different themes, activities, or player preferences, enhancing the flexibility of game design. 3) Dynamically adjust the game content according to different distribution models of operation results (such as normal distribution), thus continuously providing players with a sense of freshness. Whether designing special levels of the virtual scene or holding limited - time activities in the virtual scene, the diversity and attractiveness of the game can be maintained by adjusting the operation result, making players willing to participate in the game for a long time. 4) Due to the high degree of system automation, developers do not need to perform a large number of manual adjustments and tests, significantly reducing the time cost and labor cost of game development and maintenance. This also enables the development team to invest more resources in innovation and the expansion of game play. These beneficial effects together enhance the user experience, competitiveness, and development efficiency of the game, bringing significant value to both players and developers. 5) Determining the operation result only based on the mapping relationship can ensure that two completely identical virtual prop launch operations can produce as consistent a running trajectory as possible, thus generating the same operation result, ensuring the stability of the virtual scene operation, and also reducing the computational complexity, improving the computational efficiency, and thus enhancing the utilization rate of computing resources.
[0101] Continuing with the above example, when the player launches a virtual marble, the entire process is processed as follows: (1) The player starts the marble machine for the t - th time, preparing to shoot the virtual marble; (2) Randomly generate the expected operation result X(t) and query multiple mapping relationships; (3) Assume that the initial velocity of the virtual marble launched by the player this time is v_t. Then, find a target candidate initial velocity v’_t that is close to v_t (not necessarily the closest) among the multiple mapping relationships, and ensure that the target candidate operation result S that has a mapping relationship with the target candidate initial velocity v’_t is close to X(t) (not necessarily the closest). Thus, eject the virtual marble with v’_t and control the operation result obtained from launching the virtual marble to be the target candidate operation result S.
[0102] In some embodiments, the candidate operation results in multiple mapping relationships conform to the target distribution; when T virtual props need to be launched to complete the target task in the virtual scene, the distribution of T conforms to the target distribution, where T is an integer greater than 0. It should be noted that the target task can be preset, for example, the operation result reaches the target operation result (such as the score reaches the target score); the target distribution can be a normal distribution. In this way, the experience of completing the target task in the virtual scene can be improved, and its rationality and controllability can be ensured.
[0103] Continuing with the above example, assume that a single player spends a quantity of T virtual marbles to obtain the final reward (i.e., complete the target task). Then, the "operation result of a single launch (such as the single gain value)" and the distribution of T can be controlled. The control of the operation result of a single launch has been described above (i.e., controlled by simulating multiple mapping relationships). Next, the distribution of T will be described. Here, the generation of the player's "operation result of a single launch" is regarded as an independent and identically distributed random variable. The launch result obtained at the t-th time is X(t), and let the cumulative operation result (such as the cumulative gain value) required to finally complete the target task be N. Based on this, (1) assume that X(t) ∼ N(μ, σ 2 ) is independent and identically distributed. Since the "operation result of a single launch" is always positive, it can be assumed that μ - 3σ > 0. According to the properties of the normal distribution, the cumulative operation result S(t) at the t-th time ∼ N(tμ, tσ 2 ). In this way, a drift Brownian motion can be used to approximate the behavior of the cumulative operation result. In this model, when σ is relatively small compared to μ and N is relatively large (the characteristic is that S(t) is mainly dominated by the drift coefficient), the distribution of T can be approximated as a normal distribution: T ∼ N(N / μ, σ 2 N / μ 3 ).
[0104] For example, assume that the operation result of a single launch by the player follows a normal distribution with an expectation of 150 and a standard deviation of 40, and the cumulative operation result required for the final reward is 10000. Then, for the unbiasedness check, Signal-to-Noise Ratio (SNR) = μ / σ = 3.75 > 1, indicating that the offset is dominant; the premise for T to be close to a normal distribution is that the random fluctuations will not significantly change the mechanism of hitting N (for example, if the fluctuations are particularly large or N is small, it may lead to an asymmetric distribution). In the current example, the ratio of N = 10000 to the drift and fluctuations is relatively reasonable, and the normal approximation is valid. It can also be further verified whether T is approximately normally distributed through code simulation. Therefore, it can be considered that the distribution of T is approximately a normal distribution with a mean of about 66 and a variance of about 5. This result provides an accurate reference for the rhythm of obtaining virtual marbles and the design of the operation result of a single launch in the virtual scene.
[0105] Applying the above embodiments of the present application, when a launch operation for a virtual prop in a virtual scene is received, first generate an expected operation result of the launch operation, and obtain the motion information of the virtual prop indicated by the launch operation. Then, based on the motion information and the expected operation result, query multiple mapping relationships. When a target mapping relationship is queried from the multiple mapping relationships, control the virtual prop to be launched according to the target candidate motion information in the target mapping relationship, and control the operation result of the launch operation to be the target candidate operation result in the target mapping relationship; wherein, the difference between the target candidate motion information and the motion information satisfies a first difference condition, and the difference between the target candidate operation result and the expected operation result satisfies a second difference condition.
[0106] In this way, by querying the mapping relationship based on the motion information and the expected operation result, the motion information required to launch the virtual prop and the operation result that can be obtained by launching the virtual prop can be determined. Therefore, 1) without considering the layout of the virtual scene, the operation result can be quickly determined, reducing the occupancy of computing resources, improving the performance of the computing device, and thus improving the stability, fluency, and authenticity of the virtual scene; 2) only based on the mapping relationship to determine the operation result, the precise control of the operation result of launching the virtual prop can be achieved, so that the distribution of the operation result can be controlled more reasonably, maintaining the balance of the operation result of the virtual scene, and improving the experience of the virtual scene; 3) since the operation result can be quickly determined without relying on the layout of the virtual scene, when designing the virtual scene, the designer does not need to repeatedly adjust the layout of the virtual scene, improving the design efficiency of the virtual scene and the scalability of the virtual scene, and being able to adapt to the design requirements of the rapidly changing virtual scene.
[0107] Next, continue to illustrate the exemplary structure of the software module implementation of the virtual scene interaction device 555 provided by the embodiments of the present application. In some embodiments, such as Figure 2As shown, the software modules in the interaction device 555 of the virtual scene stored in the memory 550 may include: a generation module 5551, configured to generate an expected operation result of the launch operation in response to a launch operation on a virtual prop in the virtual scene, and obtain the motion information of the virtual prop indicated by the launch operation; an acquisition module 5552, configured to acquire a plurality of mapping relationships, where the mapping relationships are the mapping relationships between candidate motion information and candidate operation results; a query module 5553, configured to query the plurality of mapping relationships based on the motion information and the expected operation result; a control module 5554, configured to, when a target mapping relationship is queried from the plurality of mapping relationships, control the virtual prop to be launched according to the target candidate motion information in the target mapping relationship, and control the operation result of the launch operation to be the target candidate operation result in the target mapping relationship; where the difference between the target candidate motion information and the motion information satisfies a first difference condition, and the difference between the target candidate operation result and the expected operation result satisfies a second difference condition.
[0108] In some embodiments, the generation module 5551 is further configured to make the candidate operation results in the plurality of mapping relationships conform to a target distribution; the generating the expected operation result of the launch operation includes: obtaining a target kernel function and a bandwidth parameter; based on the target kernel function and the bandwidth parameter, performing kernel density estimation on the candidate operation results in the plurality of mapping relationships to obtain a probability density function; performing a transformation on the probability density function to obtain a target function conforming to the target distribution; and generating the expected operation result of the launch operation based on the target function.
[0109] In some embodiments, the generation module 5551 is further configured to obtain a standard parameter for normalization processing, and based on the standard parameter, perform normalization processing on the probability density function to obtain a standard density function; obtain a demand parameter of the target distribution, and based on the demand parameter, perform a scale transformation on the standard density function to obtain a target function conforming to the target distribution.
[0110] In some embodiments, the generation module 5551 is further configured to determine the inverse function of the cumulative distribution function of the target function; generate a first random number conforming to a uniform distribution; call the inverse function to process the first random number to obtain a second random number sampled from the target distribution, and use the second random number as the expected operation result of the launch operation.
[0111] In some embodiments, the obtaining module 5552 is further configured to obtain a plurality of simulated motion information of the virtual item; for each piece of the simulated motion information, simulate the virtual item being launched according to the simulated motion information, and simulate the launched virtual item moving in the virtual scene; for each piece of the simulated motion information, when the virtual item launched based on the simulated motion information stops moving, determine a simulated operation result corresponding to the simulated motion information based on the simulated motion data of the virtual item in the virtual scene; collect target simulated operation results that conform to a target distribution from the plurality of simulated operation results, and collect target simulated motion information corresponding to the target simulated operation results from the plurality of simulated motion information; for each piece of the target simulated motion information, use the target simulated motion information as candidate motion information, use the target simulated operation result corresponding to the target simulated motion information as a candidate operation result, and construct a mapping relationship between the candidate motion information and the candidate operation result.
[0112] In some embodiments, the obtaining module 5552 is further configured to obtain distribution parameters of the target distribution, and determine an operation result interval based on the distribution parameters; collect a plurality of target simulated operation results that are within the operation result interval and conform to the target distribution from the plurality of simulated operation results; in some embodiments, the obtaining module 5552 is further configured to, for each of the target simulated operation results, collect a target number of target simulated motion information corresponding to the target simulated operation result from the plurality of simulated motion information; wherein the target number is not less than a preset number, and the distribution density of the target simulated motion information within the motion information interval is not less than a preset density.
[0113] In some embodiments, the querying module 5553 is further configured to determine a first difference between the candidate motion information and the motion information in each of the mapping relationships, and determine a second difference between the candidate operation result and the expected operation result in each of the mapping relationships; screen first candidate motion information corresponding to the first difference that conforms to the first difference condition from the candidate motion information in the plurality of mapping relationships; screen a first candidate operation result corresponding to the second difference that conforms to the second difference condition and has a mapping relationship with the first candidate motion information from the candidate operation results in the plurality of mapping relationships; when the first candidate motion information and the first candidate operation result are screened out, query the target mapping relationship from the mapping relationship formed by the first candidate motion information and the first candidate operation result.
[0114] In some embodiments, the candidate operation results in the plurality of mapping relationships conform to a target distribution; when T virtual props need to be launched to complete the target task of the virtual scene, the distribution of T conforms to the target distribution, where T is an integer greater than 0.
[0115] In some embodiments, the virtual scene includes at least one virtual obstacle and at least one virtual interface of the virtual prop; the control module 5554 is further configured to, after controlling the virtual prop to be launched according to the target candidate motion information in the target mapping relationship, control the virtual prop to move between at least one of the virtual obstacles; based on the movement condition of the virtual prop between at least one of the virtual obstacles, control the virtual prop to enter a target virtual interface among the at least one virtual interface; the control module 5554 is further configured to display the target candidate operation result.
[0116] It should be noted that the description of the device embodiments in this application book is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments, which will not be elaborated here. For the technical details not described in the virtual scene interaction device provided in the embodiments of the present application, they can be understood based on the description of the technical details in the above method embodiments.
[0117] The embodiments of the present application further provide a computer program product, which includes computer-executable instructions or a computer program. The computer-executable instructions or the computer program are stored in a computer-readable storage medium. The processor of the electronic device reads the computer-executable instructions or the computer program from the computer-readable storage medium, and the processor executes the computer-executable instructions or the computer program, so that the electronic device executes the virtual scene interaction method provided by the embodiments of the present application.
[0118] The embodiments of the present application further provide a computer-readable storage medium, in which computer-executable instructions or a computer program are stored. When the computer-executable instructions or the computer program are executed by a processor, it will cause the processor to execute the virtual scene interaction method provided by the embodiments of the present application.
[0119] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disc, or CD-ROM; it may also be various devices including one or any combination of the above memories.
[0120] In some embodiments, the computer-executable instructions may be in the form of a program, software, a software module, a 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 being deployed as a stand-alone program or being deployed as a module, a component, a subroutine, or other unit suitable for use in a computing environment.
[0121] As an example, the computer-executable instructions may or may not correspond to a file in a file system, may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, stored in a single file dedicated to the program being discussed, or, stored in multiple cooperating files (for example, files that store one or more modules, subroutines, or portions of code).
[0122] As an example, the computer-executable instructions may be deployed to execute on one electronic device, or on multiple electronic devices located at one location, or, on multiple electronic devices distributed at multiple locations and interconnected by a communication network.
[0123] As described above, the above are only embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and scope of the present application are all included in the protection scope of the present application.
Claims
1. A virtual scene interaction method, characterized in that: The method comprises: In response to a launch operation on a virtual prop in a virtual scene, generating an expected operation result of the launch operation, and acquiring movement information of the virtual prop indicated by the launch operation; Acquire multiple mapping relationships, where the mapping relationships are mapping relationships between candidate motion information and candidate operation results; Based on the motion information and the expected operation result, query the multiple mapping relationships; When a target mapping relationship is found from the plurality of mapping relationships, the virtual prop is controlled to be emitted according to the target candidate motion information in the target mapping relationship, and the operation result of the emission operation is controlled to be the target candidate operation result in the target mapping relationship; The difference between the target candidate motion information and the motion information satisfies a first difference condition, and the difference between the target candidate operation result and the expected operation result satisfies a second difference condition.
2. The method according to claim 1, characterized in that The candidate operation results in the multiple mapping relationships conform to the target distribution; and the generating the expected operation result of the launch operation comprises: Get the target kernel function and bandwidth parameters; Based on the target kernel function and the bandwidth parameter, performing kernel density estimation on the candidate operation results in the multiple mapping relationships to obtain a probability density function; Converting the probability density function to obtain a target function that conforms to the target distribution; Based on the objective function, an expected operational result of the transmit operation is generated.
3. The method according to claim 2, characterized in that The converting the probability density function to obtain a target function that conforms to the target distribution includes: Acquiring standard parameters for standardization processing, and based on the standard parameters, performing standardization processing on the probability density function to obtain a standard density function; The demand parameters of the target distribution are obtained, and based on the demand parameters, the standard density function is scaled to obtain a target function that conforms to the target distribution.
4. The method according to claim 2, characterized in that The generating, based on the objective function, an expected operation result of the transmitting operation comprises: Determining an inverse function of a cumulative distribution function of the objective function; Generate a first random number that conforms to a uniform distribution; The inverse function is called to process the first random number to obtain a second random number sampled from the target distribution, and the second random number is used as the expected operation result of the emission operation.
5. The method according to claim 1, characterized in that The method further comprises: Acquire multiple simulated motion information of the virtual prop; For each of the simulated motion information, simulate the virtual prop being emitted according to the simulated motion information, and simulate the emitted virtual prop moving in the virtual scene; For each of the simulated motion information, when the virtual prop emitted based on the simulated motion information stops moving, determining a simulated operation result corresponding to the simulated motion information based on the simulated motion data of the virtual prop in the virtual scene; Collecting target simulation operation results that meet the target distribution from the plurality of simulation operation results, and collecting target simulation motion information corresponding to the target simulation operation results from the plurality of simulation motion information; For each of the target simulation motion information, the target simulation motion information is used as candidate motion information, the target simulation operation result corresponding to the target simulation motion information is used as a candidate operation result, and a mapping relationship between the candidate motion information and the candidate operation result is constructed.
6. The method according to claim 5, characterized in that The step of collecting target simulation operation results that meet the target distribution from the plurality of simulation operation results comprises: Obtaining distribution parameters of the target distribution, and determining an operation result interval based on the distribution parameters; From the plurality of simulation operation results, collecting a plurality of target simulation operation results that are in the operation result interval and conform to the target distribution; The step of collecting target simulation motion information corresponding to the target simulation operation result from the plurality of simulation motion information includes: For each of the target simulation operation results, target simulation motion information of a target number corresponding to the target simulation operation result is collected from the plurality of simulation motion information.
7. The method according to claim 1, characterized in that The querying the multiple mapping relationships based on the motion information and the expected operation result includes: Determine a first difference between the candidate motion information and the motion information in each of the mapping relationships, and determine a second difference between the candidate operation result and the expected operation result in each of the mapping relationships; Selecting, from the candidate motion information in the multiple mapping relationships, first candidate motion information corresponding to the first difference that meets the first difference condition; Selecting, from the candidate operation results in the multiple mapping relationships, a first candidate operation result corresponding to the second difference that meets the second difference condition and has a mapping relationship with the first candidate motion information; When the first candidate motion information and the first candidate operation result are obtained through screening, the target mapping relationship is queried from the mapping relationship formed by the first candidate motion information and the first candidate operation result.
8. The method according to claim 1, characterized in that The candidate operation results in the multiple mapping relationships conform to the target distribution; when completing the target task of the virtual scene requires launching T virtual props, the distribution of T conforms to the target distribution, and T is an integer greater than 0.
9. The method according to claim 1, characterized in that The virtual scene includes at least one virtual obstacle and at least one virtual interface of the virtual prop; After controlling the virtual prop to be transmitted according to the target candidate motion information in the target mapping relationship, the method further includes: Controlling the virtual prop to move between at least one of the virtual obstacles; Based on the movement of the virtual prop between at least one of the virtual obstacles, controlling the virtual prop to enter a target virtual interface among the at least one virtual interface; The method further comprises: The target candidate operation result is displayed.
10. An interactive device for a virtual scene, characterized in that: The device comprises: A generating module, configured to generate an expected operation result of a launching operation on a virtual prop in a virtual scene, and obtain movement information of the virtual prop indicated by the launching operation; An acquisition module, used to acquire a plurality of mapping relationships, wherein the mapping relationships are mapping relationships between candidate motion information and candidate operation results; A query module, configured to query the plurality of mapping relationships based on the motion information and the expected operation result; A control module, configured to control the virtual prop to be emitted according to the target candidate motion information in the target mapping relationship when a target mapping relationship is queried from the multiple mapping relationships, and to control the operation result of the emission operation to be the target candidate operation result in the target mapping relationship; The difference between the target candidate motion information and the motion information satisfies a first difference condition, and the difference between the target candidate operation result and the expected operation result satisfies a second difference condition.
Citation Information
Patent Citations
Equipment operation evaluation method, device and system, medium and electronic equipment
CN110163462A
Method and device for controlling virtual object in virtual scene, equipment and storage medium
CN113262488A
Game control method and device, equipment and storage medium
CN115569381A
Control system and method
CN117043701A
Systems and methods for modeling live events
US11741276B1