Crosshair indication and hit position determination method for virtual reality shooting games

By training the motion state prediction model and building a flight simulation model, combined with the intelligent delay compensation algorithm, the quasi-centric hit position rendering delay problem caused by network delay in virtual reality shooting games is solved, and the accuracy of shooting games is improved.

CN118286684BActive Publication Date: 2024-11-22JIANGSU LANCHUANG CULTURE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410483108.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-19
Publication Date
2024-11-22
Estimated Expiration
2044-04-19

AI Technical Summary

Technical Problem

In virtual reality shooting games, the deviation between the quasi-centric indication and hit position judgment due to network delays is reduced, which reduces the accuracy of shooting.

Method used

By pre-collecting motion trajectory sample data, training the motion state prediction model, and building a physics-based flight simulation model, combining intelligent delay compensation algorithm, correcting the quasi-center position of the virtual bullet, adaptively adjusting the rendering position of the quasi-center on the screen, based on flight Simulation model renders the bullet flight trajectory.

Benefits of technology

Giving ideal delay compensation hit point prediction under the probability framework solves the problem of rendering delay in quasi-centric hit position caused by network delay and improves the accuracy of shooting games.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118286684B_ABST
    Figure CN118286684B_ABST
Patent Text Reader

Abstract

The invention discloses a crosshair indication and hit position judgment method for a virtual reality shooting game, and relates to the technical field of shooting game aiming. The invention collects motion trajectory sample data in advance, and based on the motion trajectory sample data, trains a motion state prediction model, builds a physics-based flight simulation model for a virtual bullet, builds an intelligent delay compensation algorithm based on the motion state prediction model and the flight simulation model, corrects the crosshair position of the virtual bullet, adaptively adjusts the rendering position of the crosshair on the screen according to the crosshair position of the virtual bullet, and renders the bullet flight trajectory based on the flight simulation model, thereby solving the problem of delay in rendering the crosshair hit position due to network delay in virtual reality shooting games.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of shooting game aiming, and in particular to a crosshair indication and hit position judgment method for virtual reality shooting games. Background Art

[0002] In VR shooting games, there is a direct correlation between the crosshair indication and the hit position judgment, and the precise matching of the two is crucial to providing a high-quality shooting experience.

[0003] The crosshair indicator is usually a small crosshair mark rendered on the screen, which represents the direction the player is aiming at at the moment. The hit position is determined by projecting a ray and intersecting it with the scene based on the direction the crosshair points to, to calculate the specific location and object of the hit.

[0004] Ideally, the position indicated by the crosshair and the hit point calculated by the ray intersection should completely coincide. However, in reality, due to the influence of network latency, there may be a certain deviation between the two, thus reducing the accuracy of shooting, especially in multiplayer online shooting games, because information needs to be transmitted between the client and the server, which will cause a certain network latency.

[0005] This delay can lead to the following two situations: the crosshair position is lagging, for example, the client uses the data from a previous time point when rendering the crosshair, or the hit position is lagging, for example, the server uses the old target position data when performing hit detection;

[0006] To this end, the present invention proposes a crosshair indication and hit position judgment method for a virtual reality shooting game. Summary of the invention

[0007] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes a crosshair indication and hit position judgment method for a virtual reality shooting game, which solves the problem of delay in rendering the crosshair hit position due to network delay in virtual reality shooting games.

[0008] To achieve the above purpose, a method for indicating a crosshair and determining a hit position for a virtual reality shooting game is proposed, comprising the following steps:

[0009] Step 1: Collect motion trajectory sample data in advance, and train the motion state prediction model based on the motion trajectory sample data;

[0010] Step 2: Build a physics-based flight simulation model for the virtual bullet;

[0011] Step 3: Based on the motion state prediction model and flight simulation model, an intelligent delay compensation algorithm is constructed to correct the position of the virtual bullet crosshair;

[0012] Step 4: According to the position of the virtual bullet crosshair, the rendering position of the crosshair on the screen is adaptively adjusted, and the bullet flight trajectory is rendered based on the flight simulation model;

[0013] The step of pre-collecting motion trajectory sample data comprises the following steps:

[0014] Step 11: Select N testers; N is the number of selected testers;

[0015] Step 12: Build a sample data collection system for each tester to collect target motion trajectory data with high precision;

[0016] Step 13: Each tester performs different types of sports actions in the test environment; the sample data collection system is used to collect sports training data of the tester each time the tester performs a sports action, and a data label is added to each sports action; the data label is the type of the sports action;

[0017] The motion training data and data annotation of each motion action of each test person constitute motion trajectory sample data;

[0018] The training of the motion state prediction model based on the motion trajectory sample data includes:

[0019] Step 21: for each group of motion trajectory sample data, the motion training data is divided into different numbers of independent motion data samples according to a fixed time window; the specific number of motion data samples is determined according to the specific duration of the motion trajectory sample data;

[0020] Step 22: converting the segmented motion trajectory data into a multivariate motion sequence consisting of multivariate time series data; the multivariate time series data includes but is not limited to position, rotation quaternion, linear velocity, angular velocity, etc.;

[0021] Step 23: Using a sequence-to-sequence encoder-decoder architecture, a motion state prediction model is built for the target motion trajectory;

[0022] The motion state prediction model is modeled as follows:

[0023] The encoder is a CNN+LSTM encoder, which uses a one-dimensional convolutional layer to extract local spatial features, and the LSTM module captures long-term temporal dependencies;

[0024] The decoder is an LSTM / GRU decoder, which generates a predicted future motion state sequence through a gated recurrent unit;

[0025] Step 24: construct three output heads at the output end of the decoder, and jointly learn multiple prediction tasks; specifically, the output heads include a position prediction head, a velocity prediction head, and a posture prediction head;

[0026] Step 25: Set the comprehensive loss function of the motion state prediction model;

[0027] The loss function is set as follows:

[0028] For the loss function of position and velocity prediction, the square loss function is used to measure the difference between the actual value and the predicted value. For the loss function of attitude prediction, the quaternion weighted loss function is used to measure the rotation error.

[0029] The weighted sum of the loss functions of position, velocity and posture prediction is used as the comprehensive loss function of the motion state prediction model;

[0030] Step 26: using the multivariate motion sequence as the input of the motion state prediction model, training the motion state prediction model until the comprehensive loss function of the motion state prediction model reaches convergence;

[0031] The construction of a physics-based flight simulation model for a virtual bullet comprises the following steps:

[0032] Step 31: Establish the coordinate system of the virtual reality scene and initialize the physical environment parameters;

[0033] Step 32: Modeling the bullet motion equation;

[0034] Step 33: Establish a flight simulation model by numerically solving the trajectory of the bullet;

[0035] The method of constructing an intelligent delay compensation algorithm based on the motion state prediction model and the flight simulation model to correct the position of the virtual bullet crosshair includes the following steps:

[0036] Step 41: Based on the motion state prediction model, predict the target's future position prediction value, velocity prediction value, and posture prediction value as the future motion state;

[0037] Step 42: by using the flight simulation model, obtaining a simulated motion trajectory of the virtual bullet when the user fires the virtual bullet in the virtual reality scene;

[0038] The method of correcting the virtual bullet crosshair position comprises the following steps:

[0039] Step 51: Map the shooter's perspective to the virtual world to obtain a parametric expression of the initial aiming direction, and build a simulation module for the interaction between rays and scenes through the game engine to find the initial hit point;

[0040] Step 52: using the GPU timestamp and the network time transfer protocol, estimate the end-to-end delay time from data collection from the shooter terminal to the server returning the real rendered image;

[0041] Step 53: preset a delay step time, and for each delay step time, obtain the future motion state of the shooting target and the simulated motion trajectory of the virtual bullet through an intelligent delay compensation algorithm, find the intersection point of the future motion state and the simulated motion trajectory, and calculate the predicted hit point corresponding to each delay step time;

[0042] Step 54: for each predicted hit point corresponding to the delay step time, a hit probability of each predicted hit point is obtained by weighted summing the estimated posterior probability distribution of the system state;

[0043] Step 55: Select the predicted hit point with the highest hit probability from all predicted hit points as the calibration hit point;

[0044] The method of adaptively adjusting the rendering position of the crosshair on the screen according to the position of the virtual bullet crosshair is as follows:

[0045] The calibration hit point is converted from the three-dimensional world coordinate system to the shooter viewport coordinate system through a spatial coordinate conversion method;

[0046] Combining the shooter's perspective and FOV parameters, the two-dimensional coordinates of the calibration hit point on the screen are obtained through perspective projection;

[0047] The two-dimensional coordinates after transmission projection are used as the center position parameters of the crosshairs;

[0048] The center position of the crosshair is passed to the GPU rendering pipeline, and the vertex / texture data is dynamically generated at the center position of the crosshair using a compute shader;

[0049] The method of rendering the bullet flight trajectory based on the flight simulation model is as follows:

[0050] Read the simulated motion trajectory corresponding to the calibration hit point, and transfer the simulated motion trajectory to the GPU memory;

[0051] Using the GPU rendering pipeline, based on the vertex / geometry shader stage, vertex data for each voxel in the simulated motion trajectory is generated.

[0052] An electronic device is proposed, comprising: a processor and a memory, wherein the memory stores a computer program that can be called by the processor;

[0053] The processor executes the above-mentioned crosshair indication and hit position determination method for virtual reality shooting games by calling the computer program stored in the memory.

[0054] A computer-readable storage medium is provided, on which a rewritable computer program is stored;

[0055] When the computer program is run on a computer device, the computer device executes the above-mentioned crosshair indication and hit position determination method for a virtual reality shooting game.

[0056] Compared with the prior art, the present invention has the following beneficial effects:

[0057] The present invention collects motion trajectory sample data in advance, trains a motion state prediction model based on the motion trajectory sample data, builds a physics-based flight simulation model for a virtual bullet, builds an intelligent delay compensation algorithm based on the motion state prediction model and the flight simulation model, corrects the virtual bullet crosshair position, adaptively adjusts the rendering position of the crosshair on the screen according to the virtual bullet crosshair position, and renders the bullet flight trajectory based on the flight simulation model; integrates target motion trajectory prediction, shooting trajectory simulation, delay estimation and other technologies, and fuses multiple sensors and visual information to finally give an ideal delay-compensated hit point prediction under a probability framework, and accurately projects it back to the shooter's viewport as the crosshair position after dynamic correction, thereby solving the problem of crosshair hit position rendering delay caused by network delay in virtual reality shooting games. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 This is a flow chart of a method for indicating a crosshair and determining a hit position for a virtual reality shooting game in Embodiment 1 of the present invention;

[0059] Figure 2 This is a flow chart of training a motion state prediction model in Embodiment 1 of the present invention;

[0060] Figure 3 This is a schematic diagram of the structure of an electronic device in Embodiment 2 of the present invention;

[0061] Figure 4 This is a schematic diagram of the computer-readable storage medium structure in Example 3 of the present invention. DETAILED DESCRIPTION

[0062] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0063] Example 1

[0064] like Figure 1As shown, a method for indicating a crosshair and determining a hit position for a virtual reality shooting game comprises the following steps:

[0065] Step 1: Collect motion trajectory sample data in advance, and train the motion state prediction model based on the motion trajectory sample data;

[0066] Step 2: Build a physics-based flight simulation model for the virtual bullet;

[0067] Step 3: Based on the motion state prediction model and flight simulation model, an intelligent delay compensation algorithm is constructed to correct the position of the virtual bullet crosshair;

[0068] Step 4: According to the position of the virtual bullet crosshair, the rendering position of the crosshair on the screen is adaptively adjusted, and the bullet flight trajectory is rendered based on the flight simulation model;

[0069] The step of pre-collecting motion trajectory sample data includes the following steps:

[0070] Step 11: Select N testers; N is the number of selected testers;

[0071] Step 12: Build a sample data collection system for each tester to collect target motion trajectory data with high precision;

[0072] Specifically, the sample data acquisition system includes any combination of an optical exoskeleton capture device, an inertial measurement unit (IMU), a depth camera array, and a time synchronization module;

[0073] Wherein, the optical exoskeleton capture device is used to reconstruct the target three-dimensional skeletal motion by triangulation principle using infrared camera and reflective markers;

[0074] Wherein, the inertial measurement unit (IMU) is used to install multiple IMU sensors at the target joint position to measure the angular velocity and acceleration of the target during movement;

[0075] Wherein, the depth camera array is used to obtain point cloud data and three-dimensional shape of the target motion using a depth camera based on structured light or ToF principle;

[0076] Wherein, the time synchronization module is used to ensure the consistency of the timestamps of the data of each device by using the Network Time Protocol (NTP) or clock synchronization signal;

[0077] Step 13: Each tester performs different types of sports actions in the test environment; the sample data collection system is used to collect sports training data of the tester each time the tester performs a sports action, and a data label is added to each sports action; the data label is the type of sports action; the sports actions include but are not limited to walking, running, jumping, fighting actions, etc.;

[0078] Specifically, the motion training data is obtained by using a sample data acquisition system to fuse and package the skeletal joint coordinates, IMU data, point cloud data, etc. through the ROS system, and each frame of data contains a complete and continuous three-dimensional motion state of the target;

[0079] The motion training data and data annotation of each motion action of each test person constitute motion trajectory sample data;

[0080] Further, such as Figure 2 As shown, the motion state prediction model is trained based on the motion trajectory sample data, including:

[0081] Step 21: for each group of motion trajectory sample data, the motion training data is divided into different numbers of independent motion data samples according to a fixed time window; the specific number of motion data samples is determined according to the specific duration of the motion trajectory sample data;

[0082] Step 22: converting the segmented motion trajectory data into a multivariate motion sequence consisting of multivariate time series data; the multivariate time series data includes but is not limited to position, rotation quaternion, linear velocity, angular velocity, etc.;

[0083] Step 23: Using a sequence-to-sequence encoder-decoder architecture, a motion state prediction model is built for the target motion trajectory;

[0084] Specifically, the motion state prediction model is modeled as follows:

[0085] The encoder is a CNN+LSTM encoder, which uses a one-dimensional convolutional layer to extract local spatial features, and the LSTM module captures long-term temporal dependencies;

[0086] The decoder is an LSTM / GRU decoder, which generates a predicted future motion state sequence through a gated recurrent unit;

[0087] Step 24: construct multiple output heads at the output end of the decoder, and jointly learn multiple prediction tasks; specifically, the output heads include a position prediction head, a velocity prediction head, and a posture prediction head, which are respectively used to output the future position trajectory of the target in the world coordinate system, the future velocity trajectory of the target in the world coordinate system, and the future rotation posture of the target in the world coordinate system;

[0088] Step 25: Set the comprehensive loss function of the motion state prediction model;

[0089] Specifically, the loss function is set as follows:

[0090] For the loss function of position and velocity prediction, the square loss function is used to measure the difference between the actual value and the predicted value. For the loss function of attitude prediction, the quaternion weighted loss function is used to measure the rotation error.

[0091] The weighted sum of the loss functions of position, velocity and posture prediction is used as the comprehensive loss function of the motion state prediction model;

[0092] Step 26: using the multivariate motion sequence as the input of the motion state prediction model, training the motion state prediction model until the comprehensive loss function of the motion state prediction model reaches convergence;

[0093] Furthermore, the construction of a physics-based flight simulation model for a virtual bullet includes the following steps:

[0094] Step 31: Establish the coordinate system of the virtual reality scene and initialize the physical environment parameters;

[0095] Preferably, the method of establishing the coordinate system of the virtual reality scene is:

[0096] Based on the right-hand coordinate system, establish related coordinate systems such as the world coordinate system and the muzzle coordinate system;

[0097] Preferably, the method of initializing the physical environment parameters is:

[0098] Set physical environment parameters such as gravity acceleration, air density, and air resistance coefficient for the virtual reality world;

[0099] Step 32: Modeling the bullet motion equation;

[0100] Preferably, the method of modeling the bullet motion equation is:

[0101] Build an air resistance model, for example, based on the bullet shape, speed and air properties, to build an accurate air resistance model.

[0102] Establish a rotational motion model, for example, consider the effects of the elevon torque and Chernofsky force on the motion of the bullet;

[0103] Establish a comprehensive model, for example, comprehensively model multiple factors such as universal gravitation, air resistance, and rotational influence to obtain a group of three-dimensional motion equations of the bullet; it is understandable that the above-mentioned air resistance model, rotational motion model and comprehensive model involve fluid dynamics theory and rigid body kinematics such as Bernoulli equation and Oppenheim approximation, which belong to common technical theories in the field of this technology, and the present invention will not be repeated here;

[0104] Step 33: Establish a flight simulation model by numerically solving the trajectory of the bullet;

[0105] Preferably, the method of numerically solving the flight simulation model of the bullet trajectory is:

[0106] Initial condition setting, for example, setting the initial position, speed and rotation parameters of the bullet according to the muzzle position, aiming direction and muzzle shake data.

[0107] Numerical integration algorithms, for example, classical numerical integration algorithms such as Runge-Kutta and Euler are used to solve differential equations.

[0108] Collision detection, for example, introducing ray / layer detection algorithms to determine the collision between bullets and scene objects in real time;

[0109] For further optimization of this embodiment, the flight simulation model can further render bullet flight animation;

[0110] The rendering of the bullet flight animation includes:

[0111] Dynamics simulation, such as putting a bullet into the physics engine as a rigid body to simulate dynamic effects such as shell ejection;

[0112] Particle rendering effects, such as using particle systems to render muzzle flash, shooting trails, and bullet impact effects;

[0113] Lighting baking, such as pre-calculating realistic light maps and updating bullet lighting effects in real time, so that the solved real-time flight trajectory of bullets can be rendered into the VR scene to provide immersive visual feedback;

[0114] Furthermore, the intelligent delay compensation algorithm is constructed based on the motion state prediction model and the flight simulation model to correct the position of the virtual bullet crosshair, including the following steps:

[0115] Step 41: Based on the motion state prediction model, predict the target's future position prediction value, velocity prediction value, and posture prediction value as the future motion state;

[0116] Specifically, the method of predicting the future position, speed and posture changes of the target is:

[0117] The real-time motion data of the shooting target is collected through the sample data collection system, and the real-time motion data is input into the motion state prediction model to obtain the position prediction value, speed prediction value and posture prediction value output by the motion state prediction model;

[0118] Step 42: by using the flight simulation model, obtaining a simulated motion trajectory of the virtual bullet when the user fires the virtual bullet in the virtual reality scene;

[0119] The method of correcting the virtual bullet crosshair position comprises the following steps:

[0120] Step 51: Map the shooter's perspective to the virtual world to obtain a parametric expression of the initial aiming direction, and build a simulation module for the interaction between rays and scenes through the game engine to find the initial hit point;

[0121] Step 52: using the GPU timestamp and the network time transfer protocol, estimate the end-to-end delay time from data collection from the shooter terminal to the server returning the real rendered image;

[0122] Step 53: preset a delay step time, and for each delay step time, obtain the future motion state of the shooting target and the simulated motion trajectory of the virtual bullet through an intelligent delay compensation algorithm, find the intersection point of the future motion state and the simulated motion trajectory, and calculate the predicted hit point corresponding to each delay step time;

[0123] Step 54: for each predicted hit point corresponding to the delay step time, a hit probability of each predicted hit point is obtained by weighted summing the estimated posterior probability distribution of the system state;

[0124] Step 55: Select the predicted hit point with the highest hit probability from all predicted hit points as the calibration hit point;

[0125] It should be noted that a more detailed explanation of step 54 is as follows:

[0126] Due to a certain delay in the system, the target position seen by the shooter when aiming is already behind the target's true position. To compensate for this delay, we need to predict the target's true position at the moment of shooting and adjust the aiming point to an ideal point that can hit that position;

[0127] Therefore, the setting of the hit point sets with different delay steps is because in the actual service area and the network connection of the terminal, the real delay time cannot be accurately known, so the hit point prediction calculation is performed for multiple possible delay steps, and then the hit probability of each predicted hit point is further considered;

[0128] The hit probability is calculated by weighted summation of the system state posterior probability distribution, and the system state posterior probability refers to:

[0129] In reality, there are various noises and uncertainties, and we cannot perfectly observe the true state of the system; therefore, we need to establish a probability model to estimate the probability distribution of the system state, which is the so-called "posterior probability distribution";

[0130] Specifically, multiple state quantities such as target motion, bullet flight, delay time, etc. are modeled as random variables, and the probability relationship (state transition model) and measurement relationship (observation model) between them are described. Then, methods such as Bayesian filtering or particle filtering are used to fuse various observation inputs (such as target detection, delay estimation, etc.) and recursively estimate the joint posterior probability distribution of state variables; the above-mentioned posterior probability model is widely used in various games, and the present invention will not be repeated here;

[0131] Furthermore, the method of adaptively adjusting the rendering position of the crosshair on the screen according to the position of the crosshair of the virtual bullet is as follows:

[0132] The calibration hit point is converted from the three-dimensional world coordinate system to the shooter viewport coordinate system through a spatial coordinate conversion method;

[0133] Combining the shooter's perspective and FOV parameters, the two-dimensional coordinates of the calibration hit point on the screen are obtained through perspective projection;

[0134] The two-dimensional coordinates after transmission projection are used as the center position parameters of the crosshairs;

[0135] The center position of the crosshair is passed to the GPU rendering pipeline, and the vertex / texture data is dynamically generated at the center position of the crosshair using a compute shader;

[0136] Furthermore, the method of rendering the bullet flight trajectory based on the flight simulation model is as follows:

[0137] Read the simulated motion trajectory corresponding to the calibration hit point, and transfer the simulated motion trajectory to the GPU memory;

[0138] Using the GPU rendering pipeline, based on the vertex / geometry shader stage, vertex data for each voxel in the simulated motion trajectory is generated.

[0139] Example 2

[0140] Figure 3 1 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 3As shown, according to another aspect of the present application, an electronic device 100 is also provided. The electronic device 100 may include one or more processors and one or more memories. The memories store computer readable codes, and when the computer readable codes are executed by one or more processors, the above-mentioned crosshair indication and hit position determination method for virtual reality shooting games can be executed.

[0141] The method or device according to the embodiment of the present application can also be used by Figure 3 The electronic device architecture shown in FIG. Figure 3 As shown, the electronic device 100 may include a bus 101, one or more CPUs 102, ROM 103, RAM 104, a communication port 105 connected to a network, an input / output component 106, a hard disk 107, and the like. The storage device in the electronic device 100, such as ROM 103 or hard disk 107, may store the crosshair indication and hit position determination method for a virtual reality shooting game provided in the present application. The crosshair indication and hit position determination method for a virtual reality shooting game may, for example, include the following steps: Step 1: Collect motion trajectory sample data in advance, and train a motion state prediction model based on the motion trajectory sample data; Step 2: Construct a physics-based flight simulation model for virtual bullets; Step 3: Construct an intelligent delay compensation algorithm based on the motion trajectory sample data and the flight simulation model to correct the crosshair position of the virtual bullet; Step 4: According to the crosshair position of the virtual bullet, adaptively adjust the rendering position of the crosshair on the screen, and render the bullet flight trajectory based on the flight simulation model;

[0142] Furthermore, the electronic device 100 may further include a user interface 108. Figure 3 The architecture shown is only exemplary and can be omitted according to actual needs when implementing different devices. Figure 3 One or more components of an electronic device are shown.

[0143] Example 3

[0144] Figure 4 Schematic diagram of a computer-readable storage medium structure provided by an embodiment of the present application. Figure 4As shown, a computer-readable storage medium 200 according to an embodiment of the present application is shown. Computer-readable instructions are stored on the computer-readable storage medium 200. When the computer-readable instructions are executed by the processor, the crosshair indication and hit position judgment method for a virtual reality shooting game according to an embodiment of the present application described with reference to the above figures can be executed. The computer-readable storage medium 200 includes, but is not limited to, for example, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.

[0145] In addition, according to the implementation of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the present application provides a non-transitory machine-readable storage medium, the non-transitory machine-readable storage medium stores machine-readable instructions, the machine-readable instructions can be run by a processor to execute instructions corresponding to the method steps provided by the present application, and when the computer program is executed by a central processing unit (CPU), the above functions defined in the method of the present application are executed.

[0146] The methods, apparatuses, and devices of the present application may be implemented in many ways. For example, the methods, apparatuses, and devices of the present application may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present application are not limited to the order specifically described above unless otherwise specified. In addition, in some embodiments, the present application may also be implemented as programs recorded in a recording medium, which include machine-readable instructions for implementing the method according to the present application. Therefore, the present application also covers recording media storing programs for executing the method according to the present application.

[0147] In addition, the parts of the above-mentioned technical solutions provided in the embodiments of the present application that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive redundancy.

[0148] The specific implementation modes as described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation mode of the present invention and is not intended to limit the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

[0149] The above preset parameters or preset thresholds are all set by technicians in this field according to actual conditions or obtained through large-scale data simulation.

[0150] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.

Claims

1. A method for indicating a crosshair and determining a hit position for a virtual reality shooting game, characterized in that: The following steps are involved: Step 1: Collect motion trajectory sample data in advance, and train the motion state prediction model based on the motion trajectory sample data; Step 2: Build a physics-based flight simulation model for the virtual bullet; Step 3: Based on the motion state prediction model and flight simulation model, an intelligent delay compensation algorithm is constructed to correct the position of the virtual bullet crosshair; Step 4: According to the position of the virtual bullet crosshair, the rendering position of the crosshair on the screen is adaptively adjusted, and the bullet flight trajectory is rendered based on the flight simulation model; The training of the motion state prediction model based on the motion trajectory sample data includes: Step 21: for each group of motion trajectory sample data, the motion training data is divided into different numbers of independent motion data samples according to a fixed time window; Step 22: converting the segmented motion trajectory data into a multivariate motion sequence consisting of multivariate time series data; Step 23: Using a sequence-to-sequence encoder-decoder architecture, a motion state prediction model is built for the target motion trajectory; The motion state prediction model is modeled as follows: The encoder is a CNN+LSTM encoder, which uses a one-dimensional convolutional layer to extract local spatial features, and the LSTM module captures long-term temporal dependencies; The decoder is an LSTM / GRU decoder, which generates a predicted future motion state sequence through a gated recurrent unit; Step 24: construct three output heads at the output end of the decoder; the output heads include a position prediction head, a velocity prediction head, and a posture prediction head; Step 25: Set the comprehensive loss function of the motion state prediction model; The loss function is set as follows: For the loss function of position and velocity prediction, the square loss function is used to measure the difference between the actual value and the predicted value. For the loss function of attitude prediction, the quaternion weighted loss function is used to measure the rotation error. The weighted sum of the loss functions of position, velocity and posture prediction is used as the comprehensive loss function of the motion state prediction model; Step 26: Using the multivariate motion sequence as the input of the motion state prediction model, the motion state prediction model is trained until the comprehensive loss function of the motion state prediction model converges.

2. The method for indicating the crosshairs and determining the hit position for a virtual reality shooting game according to claim 1, characterized in that: The step of pre-collecting motion trajectory sample data comprises the following steps: Step 11: Select N testers; N is the number of selected testers; Step 12: Build a sample data collection system for each tester to collect target motion trajectory data with high precision; Step 13: Each tester performs different types of motion movements in the test environment; a sample data acquisition system is used to collect motion training data of the tester each time the tester performs a motion movement, and a data annotation is added to each motion movement; the data annotation is the type of motion movement, and the motion training data and data annotation of each motion movement of each tester constitute motion trajectory sample data.

3. The method for indicating the crosshairs and determining the hit position for a virtual reality shooting game according to claim 2, characterized in that: The construction of a physics-based flight simulation model for a virtual bullet comprises the following steps: Step 31: Establish the coordinate system of the virtual reality scene and initialize the physical environment parameters; Step 32: Modeling the bullet motion equation; Step 33: Establish a flight simulation model by numerically solving the bullet trajectory.

4. The method for indicating the crosshairs and determining the hit position for a virtual reality shooting game according to claim 3, characterized in that: The method of constructing an intelligent delay compensation algorithm based on the motion state prediction model and the flight simulation model to correct the position of the virtual bullet crosshair includes the following steps: Step 41: Based on the motion state prediction model, predict the target's future position prediction value, speed prediction value, and posture prediction value as the future motion state; Step 42: By using the flight simulation model, a simulated motion trajectory of the virtual bullet is obtained when the user fires the virtual bullet in the virtual reality scene.

5. The method for indicating the crosshairs and determining the hit position for a virtual reality shooting game according to claim 4, characterized in that: The method of correcting the virtual bullet crosshair position comprises the following steps: Step 51: Map the shooter's perspective to the virtual world to obtain a parametric expression of the initial aiming direction, and build a simulation module for the interaction between rays and scenes through the game engine to find the initial hit point; Step 52: using GPU timestamp and network time transfer protocol, estimate the end-to-end delay time from data collection from the shooter terminal to the server returning the real rendered image; Step 53: preset a delay step time, and for each delay step time, obtain the future motion state of the shooting target and the simulated motion trajectory of the virtual bullet through an intelligent delay compensation algorithm, find the intersection point of the future motion state and the simulated motion trajectory, and calculate the predicted hit point corresponding to each delay step time; Step 54: for each predicted hit point corresponding to the delay step time, a hit probability of each predicted hit point is obtained by weighted summing the estimated posterior probability distribution of the system state; Step 55: Select the predicted hit point with the highest hit probability from all predicted hit points as the calibration hit point.

6. The method for indicating the crosshairs and determining the hit position for a virtual reality shooting game according to claim 5, characterized in that: The method of adaptively adjusting the rendering position of the crosshair on the screen according to the position of the virtual bullet crosshair is as follows: The calibration hit point is converted from the three-dimensional world coordinate system to the shooter viewport coordinate system through a spatial coordinate conversion method; Combining the shooter's perspective and FOV parameters, the two-dimensional coordinates of the calibration hit point on the screen are obtained through perspective projection; The two-dimensional coordinates after transmission projection are used as the center position parameters of the crosshairs; The center position of the crosshair is passed to the GPU rendering pipeline, and the vertex / texture data is dynamically generated at the center position of the crosshair using a compute shader.

7. The method for indicating the crosshairs and determining the hit position for a virtual reality shooting game according to claim 6, characterized in that: The method of rendering the bullet flight trajectory based on the flight simulation model is as follows: Read the simulated motion trajectory corresponding to the calibration hit point, and transfer the simulated motion trajectory to the GPU memory; Use the GPU rendering pipeline to generate vertex data for each voxel in the simulated motion trajectory based on the vertex / geometry shader stage.

8. An electronic device, characterized in that: include: processor and memory, wherein The memory stores a computer program that can be called by the processor; The processor executes the crosshair indication and hit position determination method for a virtual reality shooting game as described in any one of claims 1 to 7 in the background by calling the computer program stored in the memory.

9. A computer-readable storage medium, characterized in that: A rewritable computer program is stored thereon; When the computer program is run on a computer device, the computer device executes the crosshair indication and hit position determination method for a virtual reality shooting game as described in any one of claims 1 to 7 in the background.