Abnormality monitoring method and terminal based on physical engine reverse verification
By recording the actual motion trajectory of objects in the game in real time and combining with the physics engine's reverse calculation theoretical trajectory, it automatically detects abnormal situations that do not match the real physics laws, and solves the problem of low detection efficiency of game physics engines in the existing technology, achieving efficient and accurate abnormal monitoring.
Patent Information
- Application Number
- CN202510406052.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-08-15
AI Technical Summary
The existing game physics engines are difficult to effectively detect abnormal situations that do not match the real physical laws in complex scenarios. The existing testing methods are inefficient and lack a reverse verification mechanism.
By recording the actual motion trajectory of objects in the game in real time, and inversely computing the theoretical motion trajectory based on real physical laws, comparing outliers that exceed the threshold, an abnormality monitoring method and terminal based on reverse verification of physics engines are provided.
It improves the reliability of the game physics engine, reduces the workload of manual testing, optimizes the test process, and significantly improves the testing efficiency and accuracy.
Smart Images

Figure CN120492288A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of game physics engine testing, and in particular to an anomaly monitoring method and terminal based on physics engine reverse verification. Background Art
[0002] In game development and testing, the accuracy and reliability of physics engines are critical factors in ensuring a realistic gaming experience. Currently, most game development companies rely on physics engines (such as Havok and PhysX) to simulate in-game physical behaviors, such as collisions, gravity, and momentum. However, existing physics engines do not always conform to real-world physics in complex scenarios. This can lead to rendering anomalies or logic errors, especially in extreme situations (such as high-speed collisions and complex object interactions).
[0003] Existing game testing methods primarily rely on manual testing and automated script testing. While manual testing can detect some obvious physical anomalies, it is inefficient and prone to missing details. While automated script testing improves testing efficiency, its test cases are often pre-defined and fail to cover all possible physical interaction scenarios. Furthermore, existing testing methods lack a reverse engineering verification mechanism for physics engine simulation results, making them ineffective in detecting anomalies that deviate from real-world physical laws. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide an anomaly monitoring method and terminal based on reverse verification of a physics engine, thereby improving the reliability and testing efficiency of the game physics engine.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: An anomaly monitoring method based on physical engine reverse verification includes the following steps: S1. Real-time recording of the actual movement trajectory of objects in the game during physical events; S2. Based on the game physics engine, reversely calculate the theoretical motion trajectory of the object according to the real physical laws; S3. Compare the actual motion trajectory with the theoretical motion trajectory, and mark abnormal actual values exceeding a threshold value in the actual motion trajectory.
[0006] In order to solve the above technical problems, another technical solution adopted by the present invention is: An anomaly monitoring terminal based on physical engine reverse verification includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: S1. Real-time recording of the actual movement trajectory of objects in the game during physical events; S2. Based on the game physics engine, reversely calculate the theoretical motion trajectory of the object according to the real physical laws; S3. Compare the actual motion trajectory with the theoretical motion trajectory, and mark abnormal actual values exceeding a threshold value in the actual motion trajectory.
[0007] The beneficial effects of the present invention are: providing an anomaly monitoring method and terminal based on reverse verification of a physics engine, which can automatically detect anomalies that do not conform to real physical laws by recording the actual motion trajectory of objects in the game in real time and combining it with the reverse calculation of the theoretical motion trajectory by the physics engine, thereby improving the reliability of the game physics engine, reducing the workload of manual testing, optimizing the testing process, and significantly improving testing efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 This is an overall flow chart of an anomaly monitoring method based on physical engine reverse verification according to an embodiment of the present invention; Figure 2 The figure is a structural diagram of an abnormality monitoring terminal based on physical engine reverse verification according to an embodiment of the present invention.
[0009] Description of labels: 1. An anomaly monitoring terminal based on reverse verification of a physical engine; 2. Memory; 3. Processor. DETAILED DESCRIPTION
[0010] To illustrate the technical content, achieved objectives and effects of the present invention in detail, the following description is given in conjunction with the embodiments and accompanying drawings.
[0011] Please refer to Figure 1 , an anomaly monitoring method based on physical engine reverse verification, comprising the steps of: S1. Real-time recording of the actual movement trajectory of objects in the game during physical events; S2. Based on the game physics engine, reversely calculate the theoretical motion trajectory of the object according to the real physical laws; S3. Compare the actual motion trajectory with the theoretical motion trajectory, and mark abnormal actual values exceeding a threshold value in the actual motion trajectory.
[0012] As can be seen from the above description, the beneficial effect of the present invention lies in providing an anomaly detection method based on reverse verification of a physics engine. By recording the actual motion trajectories of in-game objects in real time and combining them with the physics engine to reversely calculate the theoretical motion trajectories, this method can automatically detect anomalies that do not conform to the laws of physics. This method improves the reliability of the game physics engine, reduces the workload of manual testing, optimizes the testing process, and significantly improves testing efficiency and accuracy.
[0013] Furthermore, the actual motion trajectory includes the actual position, actual speed and actual rotation angle of the object, and the theoretical motion trajectory includes the theoretical position, theoretical speed and theoretical rotation angle of the object; The step S2 is specifically as follows: S21. Based on the game physics engine, reversely calculate the theoretical position, the theoretical speed, and the theoretical rotation angle of the object according to real physical laws; The theoretical position is calculated by a parabola equation, which is: (1); (2); in, x ( t )and y ( t ) are the objects at time t The horizontal theoretical position and vertical theoretical position when x 0 and y 0 are the horizontal initial position and vertical initial position of the object, v x0 and v y0 are the horizontal initial velocity component and vertical initial velocity component of the object respectively, g is the acceleration due to gravity; S22. Calculate the theoretical speed using the momentum conservation equation, which is: (3); in, m 1 and m 2 are the masses of the object and the object being hit, v 1 and v 2 are the velocities of the object and the object being collided before the collision, v ’ 1 and v ’ 2 are the theoretical speeds of the object and the object being collided after the collision; S23. Calculate the theoretical angular momentum using the angular momentum conservation equation, and convert the theoretical angular momentum into the theoretical rotation angle. The angular momentum conservation equation is: (4); in, L is the theoretical angular momentum of the object, I is the moment of inertia of the object, oh is the initial angular velocity of the object.
[0014] From the above description, it can be seen that by further clarifying the specific contents of the actual motion trajectory and the theoretical motion trajectory, including the actual position, actual speed, actual rotation angle and the theoretical position, theoretical speed, and theoretical rotation angle, and by refining the parameters of the motion trajectory, physical anomalies can be detected more comprehensively, ensuring the accuracy and comprehensiveness of the detection results; at the same time, by introducing the calculation method of real physical laws, the accuracy of the theoretical values can be ensured, thereby providing a reliable theoretical basis for subsequent anomaly detection.
[0015] Furthermore, the step S3 is specifically as follows: S31, respectively calculating a difference between the actual position and the theoretical position, a difference between the actual speed and the theoretical speed, and a difference between the actual rotation angle and the theoretical rotation angle; S32: Determine whether each difference exceeds a corresponding preset tolerance threshold; if so, mark the actual motion trajectory corresponding to the difference as a potential physical anomaly.
[0016] As can be seen from the above description, the specific steps of anomaly detection have been further refined, including calculating the difference between the actual value and the theoretical value and determining whether it exceeds the preset tolerance threshold. By introducing the concept of tolerance threshold, the strictness of detection can be flexibly adjusted to adapt to the physical authenticity requirements of different games, while avoiding false positives and missed negatives.
[0017] Furthermore, the step S31 is specifically as follows: S311. The difference between the actual position and the theoretical position is calculated using the Euclidean distance formula. The Euclidean distance formula is: (5); Among them, error 位置 is the difference between the actual position and the theoretical position, x 实际 and y 实际 The actual horizontal position and the actual vertical position of the object obtained based on the game physics engine; S312: The difference between the actual speed and the theoretical speed is calculated using a speed error formula, which is: (6); (7); (8); Among them, error 速度1 and error 速度2 are the differences between the actual speed and the theoretical speed of the two objects after the collision, v x1实际 andv y1实际 are respectively the actual velocity components in the horizontal and vertical directions of one of the two objects after the collision obtained based on the game physics engine, v x2实际 and v y2实际 are respectively the actual velocity components in the horizontal and vertical directions of the other one of the two objects after the collision obtained based on the game physics engine, v ’ x1 and v ’ y1 are respectively the theoretical velocity components in the horizontal and vertical directions of one of the two objects after the collision, v ’ x2 and v ’ y2 are the theoretical velocity components of the other object in the horizontal and vertical directions after the collision, error 速度 is the difference between the actual speed and the theoretical speed finally calculated; S313: Calculate the difference between the actual rotation angle and the theoretical rotation angle using a rotation angle error formula. The rotation angle error formula is: (9); Among them, error 旋转角 is the difference between the actual position and the theoretical position, i 实际 is the actual rotation angle of the object obtained based on the game physics engine, i 理论 is the theoretical rotation angle.
[0018] As can be seen from the preceding description, the difference between the actual and theoretical values is calculated using the Euclidean distance formula, the velocity error formula, and the rotation angle error formula. The introduction of these formulas makes anomaly detection more accurate and can accurately locate specific physical anomalies (such as position deviation, velocity mutation, and rotation angle anomaly), making it easier for developers to quickly fix them.
[0019] Furthermore, after step S3, the following steps are further included: S4. Outputting the marked abnormal actual value as a detection result, and displaying the detection result through a visual interface, wherein the visual interface includes at least one of the abnormality type, abnormality location, and abnormality time; S5. Generate a repair suggestion based on the detection result, where the repair suggestion includes at least one of adjusting physical engine parameters and modifying game logic.
[0020] As can be seen from the above description, a step has been added to display the detection results through a visual interface. The display content includes information such as the anomaly type, anomaly location, and anomaly time. Through visual display, the detection results can be presented intuitively, which is convenient for developers to quickly locate and fix problems, further improving testing efficiency. At the same time, a step has been added to generate repair suggestions based on the detection results. The repair suggestions include adjusting the physical engine parameters or modifying the game logic. That is, by providing specific repair suggestions, developers can quickly solve problems, reduce debugging time, and improve development efficiency.
[0021] Please refer to Figure 2 , an anomaly monitoring terminal based on physical engine reverse verification, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented: S1. Real-time recording of the actual movement trajectory of objects in the game during physical events; S2. Based on the game physics engine, reversely calculate the theoretical motion trajectory of the object according to the real physical laws; S3. Compare the actual motion trajectory with the theoretical motion trajectory, and mark abnormal actual values exceeding a threshold value in the actual motion trajectory.
[0022] As can be seen from the above description, the beneficial effects of the present invention are: based on the same technical concept, in conjunction with the aforementioned anomaly monitoring method based on physics engine reverse verification, a physics engine reverse verification anomaly monitoring terminal is provided. By recording the actual motion trajectory of in-game objects in real time and combining it with the physics engine's reverse calculation of the theoretical motion trajectory, it can automatically detect anomalies that do not conform to the laws of physics. This method improves the reliability of the game physics engine, reduces the workload of manual testing, optimizes the testing process, and significantly improves testing efficiency and accuracy.
[0023] Furthermore, the actual motion trajectory includes the actual position, actual speed and actual rotation angle of the object, and the theoretical motion trajectory includes the theoretical position, theoretical speed and theoretical rotation angle of the object; The step S2 is specifically as follows: S21. Based on the game physics engine, reversely calculate the theoretical position, the theoretical speed, and the theoretical rotation angle of the object according to real physical laws; The theoretical position is calculated by a parabola equation, which is: (1); (2); in, x ( t )and y ( t ) are the objects at time t The horizontal theoretical position and vertical theoretical position when x 0 and y 0 are the horizontal initial position and vertical initial position of the object, v x0 and v y0 are the horizontal initial velocity component and vertical initial velocity component of the object respectively, g is the acceleration due to gravity; S22. Calculate the theoretical speed using the momentum conservation equation, which is: (3); in, m 1 and m 2 are the masses of the object and the object being hit, v 1 and v 2 are the velocities of the object and the object being collided before the collision, v ’ 1 and v ’ 2 are the theoretical speeds of the object and the object being collided after the collision; S23. Calculate the theoretical angular momentum using the angular momentum conservation equation, and convert the theoretical angular momentum into the theoretical rotation angle. The angular momentum conservation equation is: (4); in, L is the theoretical angular momentum of the object, I is the moment of inertia of the object, oh is the initial angular velocity of the object.
[0024] From the above description, it can be seen that by further clarifying the specific contents of the actual motion trajectory and the theoretical motion trajectory, including the actual position, actual speed, actual rotation angle and the theoretical position, theoretical speed, and theoretical rotation angle, and by refining the parameters of the motion trajectory, physical anomalies can be detected more comprehensively, ensuring the accuracy and comprehensiveness of the detection results; at the same time, by introducing the calculation method of real physical laws, the accuracy of the theoretical values can be ensured, thereby providing a reliable theoretical basis for subsequent anomaly detection.
[0025] Furthermore, the step S3 is specifically as follows: S31, respectively calculating a difference between the actual position and the theoretical position, a difference between the actual speed and the theoretical speed, and a difference between the actual rotation angle and the theoretical rotation angle; S32: Determine whether each difference exceeds a corresponding preset tolerance threshold; if so, mark the actual motion trajectory corresponding to the difference as a potential physical anomaly.
[0026] As can be seen from the above description, the specific steps of anomaly detection have been further refined, including calculating the difference between the actual value and the theoretical value and determining whether it exceeds the preset tolerance threshold. By introducing the concept of tolerance threshold, the strictness of detection can be flexibly adjusted to adapt to the physical authenticity requirements of different games, while avoiding false positives and missed negatives.
[0027] Furthermore, the step S31 is specifically as follows: S311. The difference between the actual position and the theoretical position is calculated using the Euclidean distance formula. The Euclidean distance formula is: (5); Among them, error 位置 is the difference between the actual position and the theoretical position, x 实际 and y 实际 The actual horizontal position and the actual vertical position of the object obtained based on the game physics engine; S312: The difference between the actual speed and the theoretical speed is calculated using a speed error formula, which is: (6); (7); (8); Among them, error 速度1 and error 速度2 are the differences between the actual speed and the theoretical speed of the two objects after the collision, v x1实际 and v y1实际 are respectively the actual velocity components in the horizontal and vertical directions of one of the two objects after the collision obtained based on the game physics engine, v x2实际 and v y2实际 are respectively the actual velocity components in the horizontal and vertical directions of the other one of the two objects after the collision obtained based on the game physics engine, v ’x1 and v ’ y1 are respectively the theoretical velocity components in the horizontal and vertical directions of one of the two objects after the collision, v ’ x2 and v ’ y2 are the theoretical velocity components of the other object in the horizontal and vertical directions after the collision, error 速度 is the difference between the actual speed and the theoretical speed finally calculated; S313: Calculate the difference between the actual rotation angle and the theoretical rotation angle using a rotation angle error formula. The rotation angle error formula is: (9); Among them, error 旋转角 is the difference between the actual position and the theoretical position, i 实际 is the actual rotation angle of the object obtained based on the game physics engine, i 理论 is the theoretical rotation angle.
[0028] As can be seen from the preceding description, the difference between the actual and theoretical values is calculated using the Euclidean distance formula, the velocity error formula, and the rotation angle error formula. The introduction of these formulas makes anomaly detection more accurate and can accurately locate specific physical anomalies (such as position deviation, velocity mutation, and rotation angle anomaly), making it easier for developers to quickly fix them.
[0029] Furthermore, after step S3, the following steps are further included: S4. Outputting the marked abnormal actual value as a detection result, and displaying the detection result through a visual interface, wherein the visual interface includes at least one of the abnormality type, abnormality location, and abnormality time; S5. Generate a repair suggestion based on the detection result, where the repair suggestion includes at least one of adjusting physical engine parameters and modifying game logic.
[0030] As can be seen from the above description, a step has been added to display the detection results through a visual interface. The display content includes information such as the anomaly type, anomaly location, and anomaly time. Through visual display, the detection results can be presented intuitively, which is convenient for developers to quickly locate and fix problems, further improving testing efficiency. At the same time, a step has been added to generate repair suggestions based on the detection results. The repair suggestions include adjusting the physical engine parameters or modifying the game logic. That is, by providing specific repair suggestions, developers can quickly solve problems, reduce debugging time, and improve development efficiency.
[0031] The present invention provides an anomaly monitoring method and terminal based on reverse verification of a physics engine, which is mainly used in the anomaly monitoring scenario of the physics engine in the game. The following is a detailed description with reference to specific embodiments: Please refer to Figure 1 , embodiment 1 of the present invention is: An anomaly monitoring method based on reverse verification of physical engines, such as Figure 1 As shown, the steps include: S1. Real-time recording of the actual motion trajectory of in-game objects in physical events.
[0032] S2. Based on the game physics engine, reversely calculate the theoretical motion trajectory of the object according to the real physical laws.
[0033] S3. Compare the actual motion trajectory with the theoretical motion trajectory, and mark abnormal actual values exceeding a threshold in the actual motion trajectory.
[0034] In other words, in this embodiment, by recording the actual motion trajectories of in-game objects in real time and inversely calculating the theoretical motion trajectories using the physics engine, anomalies that violate the laws of physics can be automatically detected. This method improves the reliability of the game physics engine, reduces the workload of manual testing, optimizes the testing process, and significantly improves testing efficiency and accuracy.
[0035] In addition, in this embodiment, after step S3, the following steps are further included: S4. Output the marked abnormal actual value as a detection result, and display the detection result through a visual interface, where the visual interface includes at least one of the following information: abnormal type, abnormal location, and abnormal time.
[0036] That is, a step is added to display the detection results through a visual interface. The display content includes information such as the anomaly type, anomaly location, and anomaly time. Through visual display, the detection results can be presented intuitively, which is convenient for developers to quickly locate and fix problems, further improving test efficiency.
[0037] In this embodiment, after step S4, the following steps are further included: S5. Generate a repair suggestion based on the detection result, where the repair suggestion includes at least one of adjusting physics engine parameters and modifying game logic.
[0038] That is, further adding the step of generating repair suggestions based on the detection results. The repair suggestions include adjusting the physical engine parameters or modifying the game logic, which can help developers quickly solve problems, reduce debugging time, and improve development efficiency.
[0039] The second embodiment of the present invention is: A method for detecting anomalies based on reverse verification of a physical engine. Based on the first embodiment described above, in this embodiment, the actual motion trajectory includes the actual position, actual speed, and actual rotation angle of the object; the theoretical motion trajectory includes the theoretical position, theoretical speed, and theoretical rotation angle of the object. The specific contents of the actual and theoretical motion trajectories are further clarified, including the actual position, actual speed, and actual rotation angle, as well as the theoretical position, theoretical speed, and theoretical rotation angle. By refining the parameters of the motion trajectory, physical anomalies can be detected more comprehensively, ensuring the accuracy and comprehensiveness of the detection results.
[0040] At the same time, physical events include at least one of explosion events, falling events and collision events, that is, the specific types of physical events are limited. These events are common physical interaction scenes in the game. By performing anomaly detection on these events, the main physical anomalies in the game can be effectively covered, thereby improving the comprehensiveness and practicality of the detection.
[0041] Then step S2 is specifically as follows: S21. Based on the game physics engine, reversely calculate the theoretical position, theoretical speed and theoretical rotation angle of the object according to the real physical laws.
[0042] For free fall or projectile motion, the theoretical position can be calculated using the parabola equation, which is: (1); (2); in, x ( t )and y ( t ) are the objects at time t The horizontal theoretical position and vertical theoretical position when x 0 and y 0 is the horizontal initial position and vertical initial position of the object, v x0 and v y0 are the horizontal initial velocity component and vertical initial velocity component of the object respectively, g is the acceleration due to gravity.
[0043] S22. In a collision event, the theoretical velocity can be calculated using the momentum conservation equation, which is: (3); in, m 1 and m 2 are the masses of the object and the object being hit, v 1 and v 2 are the velocities of the object before collision and the object being collided, v ’ 1 and v ’ 2 are the theoretical velocities of the object after collision and the object being collided.
[0044] S23. For a rotating object, angular momentum is conserved in the absence of external torque. Therefore, the theoretical angular momentum can be calculated using the angular momentum conservation equation, and the theoretical angular momentum can be converted into a theoretical rotation angle. The angular momentum conservation equation is: (4); in, L is the theoretical angular momentum of the object, I is the moment of inertia of the object, oh is the initial angular velocity of the object.
[0045] That is, in this embodiment, by introducing a calculation method based on real physical laws, the accuracy of the theoretical value can be ensured, thereby providing a reliable theoretical basis for subsequent anomaly detection.
[0046] Meanwhile, in this embodiment, step S3 is specifically as follows: S31. Calculate the difference between the actual position and the theoretical position, the difference between the actual speed and the theoretical speed, and the difference between the actual rotation angle and the theoretical rotation angle respectively.
[0047] S32: Determine whether each difference exceeds a corresponding preset tolerance threshold. If so, mark the actual motion trajectory corresponding to the difference as a potential physical anomaly.
[0048] That is, the specific steps of anomaly detection are further refined, including calculating the difference between the actual value and the theoretical value, and judging whether it exceeds the preset tolerance threshold. By introducing the concept of tolerance threshold, the strictness of detection can be flexibly adjusted to adapt to the requirements of different games for physical authenticity, while avoiding false positives and missed reports.
[0049] In this embodiment, the difference calculation method in step S31 is specifically as follows: S311. The difference between the actual position and the theoretical position is calculated using the Euclidean distance formula. The Euclidean distance formula is: (5); Among them, error 位置 is the difference between the actual position and the theoretical position, x 实际 and y 实际 The actual horizontal and vertical positions of the object obtained based on the game physics engine.
[0050] S312. The difference between the actual speed and the theoretical speed is calculated using the speed error formula. The speed error formula is: (6); (7); (8); Among them, error 速度1 and error 速度2 are the differences between the actual speed and theoretical speed of the two objects after collision, v x1实际 and v y1实际 They are respectively the actual velocity components in the horizontal and vertical directions of one of the two objects after the collision obtained based on the game physics engine. v x2实际 and v y2实际 They are respectively the actual velocity components in the horizontal and vertical directions of the other object after the collision obtained based on the game physics engine. v ’ x1 and v ’ y1 are the theoretical velocity components in the horizontal and vertical directions of one of the two objects after the collision, v ’ x2 and v ’ y2 are the theoretical velocity components of the other object in the horizontal and vertical directions after the collision, error 速度 It is the difference between the actual speed and the theoretical speed finally calculated.
[0051] S313. The difference between the actual rotation angle and the theoretical rotation angle is calculated using a rotation angle error formula. The rotation angle error formula is: (9); Among them, error 旋转角 is the difference between the actual position and the theoretical position, i 实际is the actual rotation angle of the object obtained based on the game physics engine. i 理论 is the theoretical rotation angle.
[0052] That is, the difference between the actual value and the theoretical value is calculated using the Euclidean distance formula, the speed error formula, and the rotation angle error formula. The introduction of these formulas makes anomaly detection more accurate and can accurately locate specific physical anomalies (such as position deviation, speed mutation, rotation angle anomaly, etc.), making it easier for developers to quickly fix them.
[0053] Meanwhile, in this embodiment, the tolerance threshold in step S32 specifically includes: Position error threshold, preset to Δ x =0.5m, if the deviation between the actual position and the theoretical position exceeds this threshold, it is marked as a potential vulnerability; Speed error threshold, preset to Δ v =0.1m / s. If the deviation between the actual speed and the theoretical speed exceeds this threshold, it is marked as a potential vulnerability; Rotation angle error threshold, preset to Δ i =0.05rad. If the deviation between the actual rotation angle and the theoretical rotation angle exceeds this threshold, it is marked as a potential vulnerability.
[0054] That is, by setting reasonable tolerance thresholds, including position error thresholds, speed error thresholds, and rotation angle error thresholds, the sensitivity and accuracy of detection can be effectively balanced, avoiding misjudgments or missed judgments caused by improper threshold settings.
[0055] The following provides several specific scenarios of the abnormal monitoring process of the physics engine in the game.
[0056] Scenario 1: Sudden change in vehicle speed after collision Scenario description: In a racing game, after two cars collide, the speed of one of the cars suddenly increases to an unreasonable value.
[0057] Detection method: Use the law of conservation of momentum to calculate the theoretical velocity after the collision and compare it with the actual velocity. If the deviation between the actual velocity and the theoretical velocity exceeds a set threshold (such as 1m / s), it is marked as a potential vulnerability.
[0058] Scene 2: Character Floating Against Gravity While Climbing Scenario description: In a role-playing game, a character is climbing a wall when they suddenly start to float in the air, violating the laws of gravity.
[0059] Detection method: Use the free fall equation to calculate the character's theoretical position and compare it with the actual position. If the deviation between the actual position and the theoretical position exceeds a set threshold (such as 0.5 meters), it is marked as a potential vulnerability.
[0060] Please refer to Figure 2 , the fourth embodiment of the present invention is: An anomaly monitoring terminal 1 based on physical engine reverse verification includes a memory 2, a processor 3, and a computer program stored on the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, the steps of an anomaly monitoring method based on physical engine reverse verification in any one of the above-mentioned embodiments 1 to 4 are completed.
[0061] In summary, the present invention provides an anomaly monitoring method and terminal based on physical engine reverse verification, which has the following beneficial effects: 1. Improved the reliability of the game's physics engine and ensured the accuracy of the game's physics simulation through reverse verification algorithms.
[0062] 2. The game testing process has been optimized, and automated testing has reduced manual intervention and improved testing efficiency.
[0063] 3. By defining tolerance thresholds, you can flexibly adjust the strictness of detection to meet the requirements of different games for physical authenticity.
[0064] 4. Directly locate specific physical anomalies, such as sudden speed changes or anti-gravity phenomena, so that developers can quickly fix them.
[0065] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's description and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. An anomaly monitoring method based on reverse verification of a physical engine, characterized in that: Including steps: S1. Real-time recording of the actual movement trajectory of objects in the game during physical events; S2. Based on the game physics engine, reversely calculate the theoretical motion trajectory of the object according to the real physical laws; S3. Compare the actual motion trajectory with the theoretical motion trajectory, and mark abnormal actual values exceeding a threshold value in the actual motion trajectory.
2. The anomaly monitoring method based on physical engine reverse verification according to claim 1 is characterized in that: The actual motion trajectory includes the actual position, actual speed and actual rotation angle of the object, and the theoretical motion trajectory includes the theoretical position, theoretical speed and theoretical rotation angle of the object; The step S2 is specifically as follows: S21. Based on the game physics engine, reversely calculate the theoretical position, the theoretical speed, and the theoretical rotation angle of the object according to real physical laws; The theoretical position is calculated by a parabola equation, which is: (1); (2); in, x ( t )and y ( t ) are the objects at time t The horizontal theoretical position and vertical theoretical position when x 0 and y 0 are the horizontal initial position and vertical initial position of the object, v x0 and v y0 are the horizontal initial velocity component and vertical initial velocity component of the object respectively, g is the acceleration due to gravity; S22. Calculate the theoretical speed using the momentum conservation equation, which is: (3); in, m 1 and m 2 are the masses of the object and the object being hit, v 1 and v 2 are the velocities of the object and the object being collided before the collision, v ’ 1 and v ’ 2 are the theoretical speeds of the object and the object being collided after the collision; S23. Calculate the theoretical angular momentum using the angular momentum conservation equation, and convert the theoretical angular momentum into the theoretical rotation angle. The angular momentum conservation equation is: (4); in, L is the theoretical angular momentum of the object, I is the moment of inertia of the object, ω is the initial angular velocity of the object.
3. The anomaly monitoring method based on physical engine reverse verification according to claim 2 is characterized in that: The step S3 is specifically as follows: S31, respectively calculating a difference between the actual position and the theoretical position, a difference between the actual speed and the theoretical speed, and a difference between the actual rotation angle and the theoretical rotation angle; S32: Determine whether each difference exceeds a corresponding preset tolerance threshold; if so, mark the actual motion trajectory corresponding to the difference as a potential physical anomaly.
4. The anomaly monitoring method based on physical engine reverse verification according to claim 3 is characterized in that: The step S31 is specifically as follows: S311. The difference between the actual position and the theoretical position is calculated using the Euclidean distance formula. The Euclidean distance formula is: (5); Among them, error 位置 is the difference between the actual position and the theoretical position, x 实际 and y 实际 The actual horizontal position and the actual vertical position of the object obtained based on the game physics engine; S312: The difference between the actual speed and the theoretical speed is calculated using a speed error formula, which is: (6); (7); (8); Among them, error 速度1 and error 速度2 are the differences between the actual speed and the theoretical speed of the two objects after the collision, v x1实际 and v y1实际 are respectively the actual velocity components in the horizontal and vertical directions of one of the two objects after the collision obtained based on the game physics engine, v x2实际 and v y2实际 are respectively the actual velocity components in the horizontal and vertical directions of the other one of the two objects after the collision obtained based on the game physics engine, v ’ x1 and v ’ y1 are respectively the theoretical velocity components in the horizontal and vertical directions of one of the two objects after the collision, v ’ x2 and v ’ y2 are the theoretical velocity components of the other object in the horizontal and vertical directions after the collision, error 速度 is the difference between the actual speed and the theoretical speed finally calculated; S313: Calculate the difference between the actual rotation angle and the theoretical rotation angle using a rotation angle error formula. The rotation angle error formula is: (9); Among them, error 旋转角 is the difference between the actual position and the theoretical position, θ 实际 is the actual rotation angle of the object obtained based on the game physics engine, θ 理论 is the theoretical rotation angle.
5. The anomaly monitoring method based on physical engine reverse verification according to claim 1 is characterized in that: After step S3, the following steps are also included: S4. Outputting the marked abnormal actual value as a detection result, and displaying the detection result through a visual interface, wherein the visual interface includes at least one of the abnormality type, abnormality location, and abnormality time; S5. Generate a repair suggestion based on the detection result, where the repair suggestion includes at least one of adjusting physical engine parameters and modifying game logic.
6. An abnormality monitoring terminal based on reverse verification of a physical engine, characterized in that: The invention comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented: S1. Real-time recording of the actual movement trajectory of objects in the game during physical events; S2. Based on the game physics engine, reversely calculate the theoretical motion trajectory of the object according to the real physical laws; S3. Compare the actual motion trajectory with the theoretical motion trajectory, and mark abnormal actual values exceeding a threshold value in the actual motion trajectory.
7. The abnormality monitoring terminal based on physical engine reverse verification according to claim 6 is characterized in that: The actual motion trajectory includes the actual position, actual speed and actual rotation angle of the object, and the theoretical motion trajectory includes the theoretical position, theoretical speed and theoretical rotation angle of the object; The step S2 is specifically as follows: S21. Based on the game physics engine, reversely calculate the theoretical position, the theoretical speed, and the theoretical rotation angle of the object according to real physical laws; The theoretical position is calculated by a parabola equation, which is: (1); (2); in, x ( t )and y ( t ) are the objects at time t The horizontal theoretical position and vertical theoretical position when x 0 and y 0 are the horizontal initial position and vertical initial position of the object, v x0 and v y0 are the horizontal initial velocity component and vertical initial velocity component of the object respectively, g is the acceleration due to gravity; S22. Calculate the theoretical speed using the momentum conservation equation, which is: (3); in, m 1 and m 2 are the masses of the object and the object being hit, v 1 and v 2 are the velocities of the object and the object being collided before the collision, v ’ 1 and v ’ 2 are the theoretical speeds of the object and the object being collided after the collision; S23. Calculate the theoretical angular momentum using the angular momentum conservation equation, and convert the theoretical angular momentum into the theoretical rotation angle. The angular momentum conservation equation is: (4); in, L is the theoretical angular momentum of the object, I is the moment of inertia of the object, ω is the initial angular velocity of the object.
8. The abnormality monitoring terminal based on physical engine reverse verification according to claim 7 is characterized in that: The step S3 is specifically as follows: S31, respectively calculating a difference between the actual position and the theoretical position, a difference between the actual speed and the theoretical speed, and a difference between the actual rotation angle and the theoretical rotation angle; S32: Determine whether each difference exceeds a corresponding preset tolerance threshold; if so, mark the actual motion trajectory corresponding to the difference as a potential physical anomaly.
9. The abnormality monitoring terminal based on physical engine reverse verification according to claim 8, characterized in that: The step S31 is specifically as follows: S311. The difference between the actual position and the theoretical position is calculated using the Euclidean distance formula. The Euclidean distance formula is: (5); Among them, error 位置 is the difference between the actual position and the theoretical position, x 实际 and y 实际 The actual horizontal position and the actual vertical position of the object obtained based on the game physics engine; S312: The difference between the actual speed and the theoretical speed is calculated using a speed error formula, which is: (6); (7); (8); Among them, error 速度1 and error 速度2 are the differences between the actual speed and the theoretical speed of the two objects after the collision, v x1实际 and v y1实际 are respectively the actual velocity components in the horizontal and vertical directions of one of the two objects after the collision obtained based on the game physics engine, v x2实际 and v y2实际 are respectively the actual velocity components in the horizontal and vertical directions of the other one of the two objects after the collision obtained based on the game physics engine, v ’ x1 and v ’ y1 are respectively the theoretical velocity components in the horizontal and vertical directions of one of the two objects after the collision, v ’ x2 and v ’ y2 are the theoretical velocity components of the other object in the horizontal and vertical directions after the collision, error 速度 is the difference between the actual speed and the theoretical speed finally calculated; S313: Calculate the difference between the actual rotation angle and the theoretical rotation angle using a rotation angle error formula. The rotation angle error formula is: (9); Among them, error 旋转角 is the difference between the actual position and the theoretical position, θ 实际 is the actual rotation angle of the object obtained based on the game physics engine, θ 理论 is the theoretical rotation angle.
10. The abnormality monitoring terminal based on physical engine reverse verification according to claim 6, characterized in that: After step S3, the following steps are also included: S4. Outputting the marked abnormal actual value as a detection result, and displaying the detection result through a visual interface, wherein the visual interface includes at least one of the abnormality type, abnormality location, and abnormality time; S5. Generate a repair suggestion based on the detection result, where the repair suggestion includes at least one of adjusting physical engine parameters and modifying game logic.