An optimized virtual simulation method based on intelligent physics engine
By applying an optimized virtual simulation method based on an intelligent physics engine in electronic games, the kinematic characteristics of the serpentine moving body are used to solve the problems of multi-objective motion planning and collision avoidance, and a more realistic and efficient motion simulation is achieved.
Patent Information
- Application Number
- CN202411547317.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-04-04
AI Technical Summary
In electronic games, when multiple moving bodies are planning motion in complex environments, they need to access multiple target areas at the same time and avoid collisions, resulting in complex calculations and difficult to achieve physically real motion.
The optimized virtual simulation method based on the intelligent physics engine is adopted. By initializing the intelligent physics engine and motion parameters, the moving body is imagined as a serpentine moving body, the model and kinematic parameters of the moving body are established, the shortest path is pre-calculated, and collision detection and path adjustment are performed during the motion to ensure the optimization and feasibility of the path.
More realistic motion simulation is achieved in complex environments, which can effectively deal with narrow channels and many obstacles, and improve the simulation effect.
Smart Images

Figure CN119760946A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of virtual simulation, and in particular relates to an optimized virtual simulation method based on an intelligent physical engine. Background Art
[0002] In the field of modern automation and intelligent control, virtual simulation technology has become one of the key tools. Virtual simulation provides designers and engineers with a platform to test and optimize complex systems by generating realistic scenes and accurate dynamic simulations through computers. With the deep integration of artificial intelligence and simulation technology, the "intelligent physics engine" has emerged, which can perform multi-dimensional, real-time motion planning and simulation optimization in complex environments.
[0003] However, in video games, it is often necessary to construct scenarios with multiple agents moving around, and moving the agent usually requires visiting multiple target areas while seeking to minimize the travel distance and avoid collisions with obstacles. This multi-objective motion planning problem poses unique computational challenges because it interweaves a difficult discrete problem, the traveling salesman problem (TSP), with the physical constraints imposed by agent dynamics and obstacle avoidance. It is not enough to simply compute the ordering of areas that minimizes the travel distance, which is a difficult problem in itself, even if closed tours are not required, but a collision-free and dynamically feasible trajectory must be planned that allows the agent to reach each target. The agent can restrict feasible motion by imposing restrictions on speed, turning radius, and direction of motion, making it difficult to navigate in unstructured environments with numerous obstacles and narrow passages. In order to produce physically realistic motion, the agent dynamics need to be considered during the planning process.
[0004] Based on the above problems, an optimized virtual simulation method based on intelligent physics engine is proposed. Summary of the invention
[0005] The purpose of the present invention is to provide an optimized virtual simulation method based on an intelligent physical engine, which can effectively solve the path optimization problem of a moving body in a dynamic environment based on the kinematic characteristics of a serpentine moving body.
[0006] In order to solve the above technical problems, the present invention is achieved through the following technical solutions:
[0007] An optimized virtual simulation method based on an intelligent physical engine, the method comprising:
[0008] Initialize the intelligent physics engine and motion parameters, consider the moving body as a snake-like moving body, and establish the model and kinematic parameters of the moving body;
[0009] A discrete abacus tower model is established, the workspace is discretized into multiple state regions, and a state set is defined. Logical constraints are used to ensure that each state satisfies collision avoidance and dynamic constraints.
[0010] Pre-calculate the shortest path from the starting position to each target point of the moving body, optimize the path selection based on the motion characteristics of the serpentine moving body, and reduce the calculation space through state screening;
[0011] Execute path planning, starting from the starting state, select the optimal path, and dynamically update the motion state and kinematic parameters;
[0012] Perform collision detection and path adjustment, re-plan the path when the moving body approaches an obstacle, and update in real time to ensure path optimization.
[0013] On the other hand, an optimized virtual simulation system based on an intelligent physical engine is implemented through the following technical solution, including:
[0014] Intelligent physics engine module, used to initialize the motion model and set motion parameters;
[0015] Discretization module, used to divide the workspace into discrete state regions and generate state sets according to preset conditions;
[0016] The pre-calculation module is used to calculate the shortest path between each state area and exclude the states that do not meet the constraints to optimize the path search;
[0017] The path planning module is used to select the optimal path from the starting state according to the priority function and update the motion state in real time;
[0018] A collision detection module is used to detect obstacles and adjust the path during the movement of the moving body;
[0019] The multi-target achievement module is used to select the priority target among the unfinished target points after the moving body completes the path to the current target point until the path planning of all target points is completed.
[0020] On the other hand, the following technical solution is implemented: a computer-readable storage medium stores a computer program, and when the program is executed by a processor, an optimized virtual simulation method based on an intelligent physical engine is executed.
[0021] Beneficial effects:
[0022] The present invention adopts a design based on the kinematic characteristics of a serpentine moving body, which makes the motion simulation of the method in a complex environment more realistic, can effectively cope with the situation of narrow passages and numerous obstacles, and improves the simulation effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0024] Figure 1 The present invention is a method flow chart of an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not 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.
[0026] The present invention discloses an optimized virtual simulation method based on an intelligent physics engine, which decomposes the workspace and maps the multi-objective motion planning problem into a discrete abstract space. The sampled basic motion planning and TSP solver are combined to expand the motion tree to generate collision-free and dynamically feasible trajectories, and the appropriate path is selected through the branch and bound method to optimize the computational efficiency. The flexibility of the method enables it to adapt to motion dynamics and collision constraints.
[0027] The specific steps of the method include the following steps:
[0028] Step 1: Initialize the intelligent physics engine and motion parameters;
[0029] In the intelligent physics engine, the model of the moving body is initialized as a snake model, and the kinematic parameters are set, including position coordinates, angle information, and the length and initial angle of each joint.
[0030] The snake-like moving body is connected by multiple joints and can simulate the movement of the vehicle in an area with dense obstacles. Its dynamic model is defined as follows:
[0031] State definition: The state of the snake body includes position (x, y), velocity (v), angle θ of each joint, and angular velocity θ, where i represents the i-th joint.
[0032] Equation of motion: The motion of the serpentine body is represented by the following dynamic equation:
[0033] 1. Position update equation:
[0034] 2. Update equation of front end direction angle:
[0035] 3. Speed and direction control input:
[0036] v=u a (Line speed control input);
[0037] ψ=u ω (Direction control input);
[0038] 4. The angle change equation of each joint:
[0039]
[0040] Where, v: the speed of the snake robot, θ0: the angle of the front joint, ψ: the steering angle,
[0041] yd: offset distance, used to control the bending of the joint, d: joint length, used for proportional control. Set the multi-target points of the path planning task and define the starting state of the moving body (x0, y0, θ0, φ1, φ2, ..., φ n ), (x0, y0) is the front position, θ0 is the front direction angle, is the angle of the i-th joint.
[0042] Step 2: Establish a discrete abacus tower model;
[0043] The working space of the moving body is discretized and each area is defined as a different discrete state.
[0044] The construction state set E is defined as the state set that satisfies the condition:
[0045] E={(r1,r2,...,r n ): r i ∈R i And P(r1, ..., r n ) established}
[0046] Among them, P(r1,...,r n ) is a set of logical constraints used to ensure that the state satisfies specific collision avoidance or dynamic constraints, r i It is a discrete region that can represent the position or state that a moving body can reach in the environment.
[0047] The path priority is calculated using the tower function T(E; t), which represents the optimal value of the path under a given parameter t;
[0048] T(E; t) = (ta R ) n -ta P
[0049] Among them, a RRepresents the attributes of each discrete region, a P Status attribute indicating that the path condition is not met.
[0050] Step 3: Precalculate the shortest path;
[0051] For each discrete area, the shortest path from the starting position to each target point is pre-calculated based on the kinematic characteristics of the snake-like moving body.
[0052] Use the Cartesian product to compute the paths between discrete states:
[0053] E=R1×R2×…×R n / (r1,…,r n )
[0054] By removing states that do not satisfy condition P, the search space is reduced.
[0055] Step 4: Execute path planning;
[0056] Starting from the starting state, the path with the highest priority is selected according to the tower function T(E; t).
[0057] During the movement, the kinematic parameters (position, angle, etc.) of the serpentine body are calculated and the movement state is updated. The kinematic model is as follows:
[0058]
[0059]
[0060]
[0061] Among them, v represents the velocity of the front end of the moving body, δ represents the steering angle, and L is the joint length.
[0062] Step 5: Collision detection and path adjustment;
[0063] During the path planning process, the collision detection module is used to monitor the distance between the snake-like moving body and obstacles in real time.
[0064] If a collision risk is detected, the path is replanned according to the path information of the discrete abacus tower model, and the value of the tower function T(E; t) is updated to select a new optimal path.
[0065] Step 6: Multiple goals achieved;
[0066] When the moving body reaches the current target point, the system marks the point as completed and selects the next priority target from the unfinished target points. Repeat steps 4 to 5 until the moving body completes the path planning of all target points in the predetermined order.
[0067] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0068] The preferred embodiments of the present invention disclosed above are only used to help illustrate the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.
Claims
1. An optimized virtual simulation method based on an intelligent physical engine, characterized in that: The method comprises: Initialize the intelligent physics engine and motion parameters, consider the moving body as a snake-like moving body, and establish the model and kinematic parameters of the moving body; A discrete abacus tower model is established, the workspace is discretized into multiple state regions, and a state set is defined. Logical constraints are used to ensure that each state satisfies collision avoidance and dynamic constraints. Pre-calculate the shortest path from the starting position to each target point of the moving body, optimize the path selection based on the motion characteristics of the serpentine moving body, and reduce the calculation space through state screening; Execute path planning, starting from the starting state, select the optimal path, and dynamically update the motion state and kinematic parameters; Perform collision detection and path adjustment, re-plan the path when the moving body approaches an obstacle, and update in real time to ensure path optimization.
2. The optimized virtual simulation method based on intelligent physical engine according to claim 1, characterized in that: The model and kinematic parameters of the moving body include: State definition: The state of the snake body includes position (x, y), velocity (v), angle θ of each joint, and angular velocity θ, where i represents the i-th joint; Equation of motion: The motion of the serpentine body is represented by the following dynamic equation:
1. Position update equation:
2. Update equation of front end direction angle:
3. Speed and direction control input: v=u a (Line speed control input); ψ=u ω (Direction control input); 4. The angle change equation of each joint: Among them, v: the speed of the snake robot, θ0: the angle of the front joint, ψ: the steering angle, y d : Offset distance, used to control the bending of the joint, d: Joint length, used for proportional control.
3. The optimization virtual simulation method based on intelligent physical engine according to claim 1, characterized in that: The pre-calculation process calculates the shortest path by combining paths between different state areas, and excludes states that do not meet constraint conditions, thereby narrowing the path search range.
4. The optimized virtual simulation method based on intelligent physical engine according to claim 1, characterized in that: The collision detection module monitors the distance between the moving body and the obstacle in real time, and adjusts the path to avoid the collision when a potential collision is detected.
5. The optimization virtual simulation method based on intelligent physical engine according to claim 1, characterized in that: The multi-target reaching strategy of the moving body includes recalculating the priority of unfinished target points each time a target point is reached, and gradually completing the path planning of all target points.
6. An optimized virtual simulation system based on an intelligent physical engine, characterized in that: The system comprises: Intelligent physics engine module, used to initialize the motion model and set motion parameters; Discretization module, used to divide the workspace into discrete state regions and generate state sets according to preset conditions; The pre-calculation module is used to calculate the shortest path between each state area and exclude the states that do not meet the constraints to optimize the path search; The path planning module is used to select the optimal path from the starting state according to the priority function and update the motion state in real time; A collision detection module is used to detect obstacles and adjust the path during the movement of the moving body; The multi-target achievement module is used to select the priority target among the unfinished target points after the moving body completes the path to the current target point until the path planning of all target points is completed.
7. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, executes the optimized virtual simulation method based on an intelligent physical engine as described in any one of claims 1 to 5.