An object state abnormality automatic correction system and method based on unreal engine 5

CN122605186APending Publication Date: 2026-08-21SHANGHAI YINSHENG INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610743043.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-27
Publication Date
2026-08-21

AI Technical Summary

Technical Problem

[0005]本发明旨在解决现有技术中角色卡死检测实时性差、资源占用高,以及角色穿模跌落水体后缺乏有效校正机制的问题,并克服现有方案中因持续轮询导致的性能浪费

Benefits of technology

[0020] Existing solutions require detection every frame or every fixed time window, regardless of whether the character is abnormal, leading to wasted CPU/GPU resources. This invention features a unique "asynchronous triggering + one-time sampling" mechanism: the anomaly trigger monitoring unit only outputs a trigger signal when there is an "abnormal displacement integral and input-displacement mismatch" (stuttering) or when the character comes into contact with a water collision object (clipping and falling). The detection execution unit and correction execution unit only perform a physical environment sampling once upon receiving this signal. In over 99% of normal operating frames, the system is completely in a "dormant" state, and the number of detections is proportional to the frequency of abnormal events rather than the frame rate. Real-world testing shows that in complex open-world scenes, the detection overhead of this invention can be reduced to less than 1/1000 of existing solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122605186A_ABST
    Figure CN122605186A_ABST
Patent Text Reader

Abstract

The application discloses a kind of object state abnormality automatic correction system and method based on unreal engine 5, belong to computer graphics and game development technical field.The present application aims to solve the problems of big performance overhead in character stuck detection, lack of effective correction mechanism in the prior art.The system of the present application includes abnormal trigger monitoring unit, detection execution unit and correction execution unit;Abnormal trigger monitoring unit monitors first condition or second condition, first condition is that character displacement integral is lower than threshold and user input is not matched with displacement, second condition is that character and whole map water body collision body contact;When any condition is satisfied, detection execution unit executes one-way physical environment sampling, and correction execution unit moves character to safe position according to sampling result.The present application also provides corresponding correction method.The present application uses asynchronous trigger and one-time sampling strategy, greatly reduces performance overhead, and realizes the unified automatic correction of stuck and through model drop.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer graphics and game development technology, specifically to an automatic correction system and method for object state anomalies based on Unreal Engine 5. Background Technology

[0002] In existing 3D game development, when virtual characters move through complex terrain (such as narrow gaps, irregular grids, cliff edges, etc.), they often get "stuck" and unable to move further due to calculation errors between colliders and terrain geometry. To solve this problem, existing technologies typically employ continuous raycasting or periodic heartbeat packet monitoring (e.g., emitting a detection ray forward every frame, or recording changes in the character's position at fixed time intervals). However, these solutions incur significant CPU / GPU performance overhead, especially in open-world scenes with a large number of interactive characters, where the performance loss is even more pronounced.

[0003] On the other hand, in scenes involving large bodies of water (such as oceans and lakes) that cover the entire map, if a character falls underwater after crossing the surface due to a physics engine error (such as a collision response failure or passing through a collider), conventional techniques often lack an effective automatic correction mechanism. Some solutions trigger a reset by continuously detecting whether the character's Z-axis height (vertical coordinate) is lower than the terrain height, but this method also wastes performance per frame for detection and cannot distinguish between normal diving behavior and clipping-through fall behavior, which can easily lead to miscorrection.

[0004] Therefore, there is an urgent need for a low-overhead, high-precision abnormal state detection and automatic correction solution that can solve the problems of character freezing and clipping / falling off the plane separately or simultaneously without significantly increasing performance burden. Summary of the Invention

[0005] The present invention aims to solve the problems of poor real-time performance and high resource consumption of character stuck detection in the prior art, as well as the lack of an effective correction mechanism after a character clips through and falls into water, and to overcome the performance waste caused by continuous polling in the existing solution.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] This invention provides an automatic object state anomaly correction system based on Unreal Engine 5. The system adopts the core idea of ​​"asynchronous triggering": physical environment sampling is performed only once when specific abnormal conditions are met, rather than scanning every frame.

[0008] Specifically, the system includes an anomaly trigger monitoring unit, a detection execution unit, and a correction execution unit. The anomaly trigger monitoring unit is connected to both the character state monitoring module and the water collision body, and monitors two preset asynchronous trigger conditions: a first condition (related to stuttering) and a second condition (related to clipping and falling). When at least one of the first condition (displacement integral below a threshold and user input not matching displacement) or the second condition (character contact with water collision body) is met, the unit outputs a trigger signal. The detection execution unit is connected to the monitoring unit and performs a unidirectional physical environment sampling (such as capsule ray or straight ray) only once upon receiving the trigger signal. The correction execution unit is connected to the detection execution unit and moves the character to a safe position based on the sampling result. Through this event-driven rather than polling-driven architecture, the system performs no detection in the vast majority of frames, thus reducing performance overhead to near zero.

[0009] To prevent the system from misclassifying legitimate suspended locations (such as bridges and aerial walkways) as stuttering or fall points, this invention further incorporates an art asset preprocessing module. This module adds a "Terrain detection" identifier to the terrain assets to identify valid walkable surfaces during ray sampling. Simultaneously, it places detection culling components (e.g., named "BP_RemoveTerrainDetection") on non-surface structures such as bridges and aerial walkways. Its working principle is as follows: when the ray scan of the detection execution unit hits this component, the hit point is automatically filtered, and the system no longer considers it a correctable location. Thus, when a character walks normally on a bridge, even if the displacement integral is zero, they will not be mistakenly pulled to the ground below, achieving accurate exemption for legitimate suspended scenes.

[0010] To balance sensitivity and anti-interference in "stuck" detection, this invention quantifies and limits the parameters in the first condition. Extensive scenario testing revealed that setting the time window to 1 second, the displacement integral threshold to 0.1 engine units, and maintaining a state where the user input vector magnitude is greater than 0.2 and the character's instantaneous velocity magnitude is less than 0.05 for more than 0.5 seconds effectively distinguishes between "character stuck by terrain" and "character naturally remaining still." The working principle is as follows: the system accumulates the actual movement distance of the character each frame and compares the integral values ​​at the end of the 1-second window; simultaneously, it monitors the vector magnitude of the input device and the character's physical velocity magnitude. When the user is continuously operating (input magnitude > 0.2) while the character remains almost still (velocity magnitude < 0.05) and this state lasts for more than half a second, it can be confirmed that the character is physically stuck, thus triggering a correction. This parameter combination ensures low latency while avoiding frequent false triggers.

[0011] To balance success rate and computational resources in stutter correction, this invention limits the type, radius, and retry strategy of ray scanning. The detection execution unit uses capsule-shaped ray scanning (its shape is consistent with the character's collider), with a search radius set to 2 to 3 times the radius of the character's capsule. This ensures coverage of possible escape points around the character without scanning too far and causing unreasonable jumps. When a scan fails to find a walkable point, the correction execution unit does not immediately give up but retry a maximum of 3 times, with each retry 0.5 seconds apart—because surrounding objects may move slightly or the player may make minor adjustments when the character is stuck, a short wait before rescanning improves the success rate. If all 3 attempts fail, an error log is output and the process is abandoned, avoiding infinite loops that consume performance.

[0012] To address the potential issues of secondary clipping or physics jitter caused by directly moving the character, and to respect the user's active control, this invention further restricts the actions of the correction execution unit. When moving the character, a coordinate setting function with a physics teleportation flag (such as SetActorLocation in UE5 with bTeleport=true) is used. This flag instructs the engine to skip continuous collision detection and velocity integration, instantly teleporting the character to the target point, thus avoiding bouncing or repeated clipping caused by physics simulation. Simultaneously, an interruption mechanism is introduced: if new valid user input (input vector magnitude > 0.2) is received during correction execution (including the retry waiting phase), all ongoing correction attempts are immediately interrupted. Thus, if the player suddenly presses jump or changes direction after getting stuck, the system immediately relinquishes control, preventing the correction action from conflicting with the player's intentions and greatly improving the smoothness of the operation.

[0013] To achieve single-point coverage of all water bodies across the entire map and simplify the art workflow, this invention features a specially configured pre-placed water collider. This collider is placed at the level's origin (0,0,0), and its collision range is set to an infinite plane (e.g., with Unreal Engine 5's infinite range option enabled) or a thin box with a scaling factor greater than 10,000. Its working principle is that regardless of where a character penetrates the ground due to a physics error, their capsule will inevitably overlap with this map-wide collider at a specific depth, triggering the OnComponentBeginOverlap event. This allows developers to achieve global fall detection by placing only one Actor and configuring it once, eliminating the need for separate triggers for each body of water and every terrain crevice, significantly reducing art deployment costs.

[0014] When the second condition is triggered, the system needs to quickly obtain the terrain height to determine if clipping has occurred. To this end, the detection unit executes a downward-firing straight ray, sampling vertically downwards from the character's current position to obtain the actual terrain height. The correction unit compares the character's current Z-axis coordinate with this terrain height: if the character's Z-coordinate is lower than the terrain height, it means the character has clipped through the surface (a clipping fall has occurred), and a lift is executed. This process requires only one ray sampling and is only executed when the character comes into contact with water, avoiding performance waste from detection per frame. Furthermore, the straight ray is independent of the character's capsule shape, penetrating all objects directly to the terrain surface, ensuring the accuracy of the height data.

[0015] To prevent clipping errors caused by a character's Z-coordinate briefly falling below the terrain surface during normal diving or water entry (e.g., slight foot embedding), this invention introduces a clipping tolerance parameter. The correction unit adds a check before lifting: lifting is only performed if the character's Z-coordinate is less than the actual terrain height minus the clipping tolerance (preferably 10 engine units); otherwise, the correction is skipped, maintaining the character's normal swimming or falling state. This tolerance acts as a safety buffer—when the character's penetration depth exceeds 10 units, it is considered a genuine physical error; if it's only embedded a few centimeters, it's considered normal ground contact or water surface fluctuation. This ensures reliable correction of abnormal situations without interfering with the original physics of the game.

[0016] To ensure the character doesn't immediately pierce the ground again or experience unnatural floating after being lifted, this invention precisely defines the safe height and subsequent physical state. The safe height is calculated as: actual terrain height + half-height of the character's capsule + a vertical offset of 50 to 100 engine units. The half-height ensures the character's bottom just touches the ground, and the offset provides additional buoyancy (suitable for water scenarios). More importantly, the correction execution unit forcibly resets the character's falling velocity component to zero (i.e., calls Velocity.Z = 0) while performing the lift. This is because characters typically have a downward physical velocity when piercing the ground; if lifted directly without resetting the velocity, the residual velocity would cause the character to pierce the ground again momentarily. By resetting the velocity, the lifted character will stand stably on the ground or float on the water, achieving a seamless transition to the normal state.

[0017] Corresponding to the aforementioned system, this invention also protects an automatic correction method for object state anomalies based on Unreal Engine 5. This method solves the same technical problem as the system—reducing performance overhead and uniformly handling two types of anomalies. It includes three steps: an anomaly trigger monitoring step, a detection execution step, and a correction execution step. In the anomaly trigger monitoring step, the system continuously listens for either a first condition (low displacement integral and input-displacement mismatch) or a second condition (water collision contact); when either condition is met, it is considered that the asynchronous trigger condition has been satisfied. Subsequently, the detection execution step performs a unidirectional physical environment sampling only once at the instant the condition is satisfied (using a capsule ray for lag and a downward straight ray for falls). Finally, the correction execution step moves the character to a safe position based on the sampling results. All preferred features of this method (such as retry mechanism, interrupt mechanism, clipping tolerance, speed reset, etc.) can be implemented with reference to the aforementioned system. By asynchronously binding the detection action with the anomaly event, this method reduces the detection overhead by several orders of magnitude while ensuring timely correction.

[0018] The beneficial effects that the automatic object state anomaly correction system and method based on Unreal Engine 5 disclosed in this application may bring include, but are not limited to:

[0019] I. A revolutionary reduction in performance overhead

[0020] Existing solutions require detection every frame or every fixed time window, regardless of whether the character is abnormal, leading to wasted CPU / GPU resources. This invention features a unique "asynchronous triggering + one-time sampling" mechanism: the anomaly trigger monitoring unit only outputs a trigger signal when there is an "abnormal displacement integral and input-displacement mismatch" (stuttering) or when the character comes into contact with a water collision object (clipping and falling). The detection execution unit and correction execution unit only perform a physical environment sampling once upon receiving this signal. In over 99% of normal operating frames, the system is completely in a "dormant" state, and the number of detections is proportional to the frequency of abnormal events rather than the frame rate. Real-world testing shows that in complex open-world scenes, the detection overhead of this invention can be reduced to less than 1 / 1000 of existing solutions.

[0021] II. Unified Architecture for Handling Dual Exceptions

[0022] Existing technologies typically handle stuttering and clipping issues separately, leading to code redundancy and maintenance difficulties. This invention abstracts these two seemingly disparate anomalies into a single "condition monitoring → one-time sampling → position correction" framework. An anomaly trigger monitoring unit uniformly receives the first condition (stuttering) and the second condition (falling), the detection execution unit automatically switches between a capsule-shaped ray and a downward linear ray based on the condition type, and the correction execution unit uniformly performs position movement. This architecture not only simplifies system design but also possesses excellent scalability—adding a third type of anomaly in the future (such as being pressed by an object) only requires adding the corresponding trigger condition to reuse the existing sampling and correction logic.

[0023] III. Smart Interruption and Physical Transfer in Lag Correction

[0024] Existing lag correction solutions often forcibly override user control upon triggering, resulting in a fragmented player experience. This invention introduces an interruption mechanism into the correction execution unit: if any valid new user input is detected during correction execution (including the retry waiting phase), all correction attempts are immediately interrupted, unconditionally returning control to the player. Simultaneously, a coordinate setting function with a physical teleportation flag is used to instantly move the character to a walkable point, avoiding secondary clipping or physical jitter. This design allows the correction process to be completed without the user's awareness or at any time, solving the lag problem while respecting the user's active control.

[0025] IV. Precise Tolerance and Speed ​​Reset in Mold Drop Correction

[0026] Conventional fall detection schemes either poll every frame, wasting performance, or misclassify normal dives as clipping. This invention utilizes water colliders as asynchronous trigger sources, sampling only once upon contact. Simultaneously, a clipping tolerance (e.g., 10 engine units) is set in the correction execution unit—elevation is only executed when the character's penetration depth exceeds this threshold; otherwise, normal swimming or falling continues, perfectly distinguishing between physical errors and legitimate behavior. Furthermore, the elevation simultaneously forces a reset of the character's falling velocity component to zero, fundamentally eliminating secondary penetration caused by residual velocity after elevation, allowing the character to seamlessly transition from abnormal states to normal gameplay.

[0027] V. Minimalist Art Design and High Robustness

[0028] Existing solutions require setting up individual triggers or colliders for each hazardous area, resulting in a large deployment workload. This invention, by placing a single collider at the level's origin and configuring it as an infinite plane or ultra-large scale, can cover the entire water area without repeated placement. Simultaneously, a detection culling component precisely filters legal suspended locations such as bridges and aerial walkways, avoiding erroneous corrections. This design minimizes the workload of art preprocessing and demonstrates extremely high robustness in complex scenes such as open worlds and vast terrains.

[0029] In summary, this invention solves two long-standing technical problems in game development—character lag and clipping / falling—at extremely low performance cost, significantly improving user experience and simplifying the development process. It has outstanding substantive features and significant progress. Attached Figure Description

[0030] Figure 1 This is a diagram showing the overall module structure of the system in this application.

[0031] Figure 2 This is a flowchart of the method in this application.

[0032] Figure 3 A flowchart for handling situations where a character gets stuck in the canyon terrain.

[0033] Figure 4 A flowchart illustrating the clipping process of a character falling underwater. Detailed Implementation

[0034] Various exemplary embodiments, features, and aspects of this application will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.

[0035] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, an indirect connection through an intermediate medium, or the internal communication between two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0036] To facilitate understanding of this invention, the following key terms are first defined:

[0037] Terrain assets: These refer to resources used in game engines (especially Unreal Engine 5) to construct the surface geometry, colliders, and associated meshes of the game world, including but not limited to landscape terrain generated from heightmaps, terrain colliders, and custom data added by developers.

[0038] Displacement integral: refers to the cumulative value of the actual distance a character moves over a period of time, obtained by recording the character's position changes in each frame and accumulating the values.

[0039] User input vector modulus: refers to the length of the movement intention vector obtained from the user input device (such as joystick, keyboard WASD). The value range is usually 0 to 1, where 0 represents no input and 1 represents the maximum input.

[0040] Instantaneous velocity modulus: refers to the length of the character's physical velocity vector in the current frame (usually obtained from the game engine's GetVelocity() function).

[0041] Capsule Ray Scan: This refers to using a capsule with the same shape as the character's collider to perform a spatial scan, detecting collisions with surrounding objects to determine the position where the character can stand.

[0042] Physics teleportation flag: refers to the parameter that instructs the engine to skip continuous collision detection and velocity integration in the physics simulation and directly teleport the character instantly when setting the character's position (such as the bTeleport parameter of the SetActorLocation function in UE5).

[0043] Clipping tolerance: refers to a reserved depth threshold used to distinguish between "clipping falls" that actually penetrate terrain and normal character parts embedded in the ground or water surface, avoiding miscalibration.

[0044] Half-height of the character capsule: refers to the half-height of the character capsule component in Unreal Engine 5, which is the vertical distance from the center of the capsule to the top or bottom.

[0045] Detection and removal component: refers to a special collider (e.g., named BP_RemoveTerrainDetection) placed on a legal suspended structure (such as a bridge or aerial walkway). When a ray scan hits this component, the system will ignore the hit point, thereby avoiding incorrect correction of legal suspended positions.

[0046] Example 1: System Overall Architecture

[0047] like Figure 1 As shown, this embodiment provides an automatic object state anomaly correction system based on Unreal Engine 5, including:

[0048] The art asset preprocessing module is deployed during the level editing stage. This module adds a Boolean type identifier "Terrain detection" to terrain assets (i.e., resources used in game engines to construct surface geometry, colliders, and associated meshes, such as Landscape in Unreal Engine 5) for subsequent ray sampling to identify valid surfaces. Simultaneously, on structures such as bridges and aerial walkways where there is no ground support underneath and characters can pass normally, a detection culling component called "BP_RemoveTerrainDetection" (usually an invisible box collider) is placed. The function of this component is: when a ray sample hits this component, the program determines that the current character is in a legal suspended position, and no longer triggers stuttering correction, thus preventing the player from being mistakenly pulled from the bridge to the ground below.

[0049] The exception trigger monitoring unit is responsible for monitoring two asynchronous triggering conditions:

[0050] First condition: The character's displacement integral (i.e., the cumulative value of the character's actual movement distance) within a 1-second time window is less than 0.1 engine units, and the user input vector magnitude (the length of the vector of the user's input intention) is greater than 0.2 but the character's instantaneous velocity magnitude (the length of the physical velocity vector in the current frame) is less than 0.05, and this state lasts for more than 0.5 seconds.

[0051] The second condition is that the character makes an overlapping contact with a pre-set water collider on the entire map (OnComponentBeginOverlap).

[0052] When any of the above conditions is met, the asynchronous triggering condition is considered to be satisfied.

[0053] The detection execution unit is connected to the abnormal trigger monitoring unit. When the asynchronous trigger condition is met and it is the first condition, this unit performs a capsule ray scan (using a capsule with the same shape as the character's collider for spatial scanning), with the scan radius set to 2.5 times the radius of the character's capsule and the channel set to "WorldStatic", searching for standable surfaces around the character; when the asynchronous trigger condition is met and it is the second condition, this unit performs a downward-firing straight ray to obtain the actual height of the terrain.

[0054] The correction execution unit connects to the detection execution unit. Based on the detection results, it executes the corresponding character position correction actions. For stuttering correction, the correction execution unit calls `SetActorLocation(NewLocation, false, nullptr, true)` at a found walkable point (where `bTeleport=true` is a physical teleportation flag, instructing the engine to instantly move the character), and enables a retry mechanism of up to 3 attempts with an interval of 0.5 seconds each. If no walkable point is found, the search radius and height are expanded. Furthermore, during correction execution, if the anomaly trigger monitoring unit detects valid new user input (i.e., the input vector magnitude is greater than 0.2), the ongoing correction attempt is immediately interrupted to prevent system and user control conflicts. For fall correction, the correction execution unit first determines: if the character's current Z coordinate is less than the terrain height minus 10 engine units (clipping tolerance, i.e., the reserved depth threshold used to distinguish between real clipping and normal embedding), then calculate the target height = terrain height + half height of the character's capsule (the vertical distance of the character's collider from the center to the top) + 80 engine units (safe offset), then set the new position, and force the character's falling speed (Z-axis velocity) to zero.

[0055] Example 2: Handling process when a character gets stuck in a canyon terrain

[0056] See Figure 3 The following example illustrates the process of handling the first condition, using the scenario of a character getting stuck in a narrow canyon crevice as an example.

[0057] Monitoring Phase: The game logic records the character's displacement integral (i.e., the sum of the distance moved from the previous frame to the current frame) every frame. It also records the input vectors from the player's input devices (e.g., the values ​​of the joystick or WASD keys).

[0058] Judgment Phase: At the end of a 1-second sliding time window, the system calculates the total displacement integral within that window. If the integral value is < 0.1, and the input vector magnitude is > 0.2 for most of the time within the window (e.g., >90%), but the corresponding instantaneous velocity magnitude is < 0.05, then the system is judged to be in a "stuck" state (i.e., the user wants to move but cannot). At this time, the asynchronous triggering condition is met (the first condition is met).

[0059] Sampling Phase: The detection execution unit initiates a capsule-body ray scan. Centered on the bottom of the character, with a radius of 150 cm (assuming the character's capsule radius is 60 cm, 2.5 times is 150 cm), the capsule scan is emitted downwards and in all directions to find walkable points with surface normals pointing upwards and not covered by the detection and removal components.

[0060] Correction Phase: If a valid point is found, the correction execution unit will teleport the character to that point (using SetActorLocation and enabling bTeleport), and simultaneously record the correction log. If a suitable point is not found on the first attempt due to complex terrain, wait 0.5 seconds and retry, with a maximum of 3 retries; if it still fails, output an error log and abandon this correction.

[0061] Interruption mechanism: If, during the 0.5-second wait period before the first retry, the player suddenly presses the jump button or the joystick direction changes, and the system receives new valid input (input vector magnitude > 0.2), then the subsequent retry will be immediately canceled, and control will be returned to the player.

[0062] Example 3: Process for handling characters clipping through and falling underwater

[0063] See Figure 4 This embodiment demonstrates the complete handling process for the second condition, specifically for a character who falls into water due to a physical collision error while crossing the terrain surface.

[0064] Environment Setup: Place an Actor named "BP_WaterCollision" in the level, positioning it at the world coordinate origin. Set the Actor's collider to a thin box with a scaling factor greater than 10,000 (e.g., scaling a Box component with a default side length of 100 units to 15,000 units to obtain a massive collider with a side length of 1,500,000 units), or directly enable the infinite plane collision feature in Unreal Engine 5 (e.g., using UBoxComponent and checking the bIsInfiniteExtent option), ensuring it covers the entire playable area of ​​the level. Set the collider's collision response to "Pawn Triggered" or "Overlap," only generating overlap events with character classes.

[0065] Triggering Phase: Due to a physics bug, the character crosses the terrain mesh, and its capsule-shaped collider enters the range of BP_WaterCollision. The system automatically calls the OnComponentBeginOverlap event, and the exception trigger monitoring unit captures this event, determining that the asynchronous triggering condition has been met (the second condition is met).

[0066] Detection and Judgment Phase: The detection unit immediately fires a straight ray downwards from the character's current position. The ray length is set to be sufficient to penetrate from the top of the skybox to the deepest part of the terrain (e.g., 50,000 units). The ray channel is set to "WorldStatic," and the terrain height is read from the hit result. Afterwards, the correction unit compares the character's current Z-coordinate with the terrain height.

[0067] If the character's Z-coordinate is greater than the terrain height + 10 (clipping tolerance), it means the character is standing on the ground or swimming normally, and no lifting will be performed; the character will remain in its original state.

[0068] If the character's Z-coordinate is less than or equal to the terrain height plus 10, it means the character has penetrated the surface and fallen into the water. In this example, the character's Z-coordinate is equal to the terrain height minus 50, which satisfies the condition.

[0069] Correction Phase: The corrected execution unit calculates the target height as follows: Target height = Terrain height + Half-height of the character's capsule (assumed to be 90 units) + 80-unit offset = Terrain height + 170 units. Then, `SetActorLocation` is called to forcibly increase the character's height to this value. Next, `Character->GetCharacterMovement()->Velocity.Z = 0` is called to reset the character's vertical velocity to zero, preventing the character from passing through again due to residual physical velocity. At this point, the character appears to emerge from the water and enter a normal swimming state (if the height is within the water's range according to the game logic). Throughout this process, the player will not experience any negative effects from freezing or clipping.

[0070] Example 4: Art Resource Deployment and Removal Mechanism

[0071] The deployment of art resources in this invention is extremely simple.

[0072] In a level, if there is a bridge spanning a canyon, developers only need to cover the walking surface of the bridge with a trigger box of the same shape (BP_RemoveTerrainDetection) and set it to "Overlap". When the ray scan of the stutter detection hits this component, the ray will be filtered out (i.e., the hit point is ignored), thus preventing the system from judging the bridge as a "stuck" position that needs correction and considering the character to be in a legal suspended state.

[0073] Developers only need to place the Actor at the level's origin coordinates and configure its collision range to an infinite plane or a super-large scale (such as a scaling factor greater than 10,000) to achieve full-map water collision coverage, without needing to place separate triggers for each body of water. This method is particularly suitable for open-world ocean or large lake scenes.

[0074] Example 5: Automatic Correction Method for Object State Anomalies

[0075] See Figure 2 This embodiment provides an automatic correction method for object state anomalies based on Unreal Engine 5. This method can be run in any of the aforementioned system embodiments and includes the following steps:

[0076] Step S1 (Abnormal Trigger Monitoring Step): Monitor preset asynchronous trigger conditions, which include a first condition or a second condition. The first condition is that the character's displacement integral within a 1-second time window is less than 10 engine units, the user input vector magnitude is greater than 0.2, and the character's instantaneous velocity magnitude is less than 0.05 for more than 0.5 seconds. The second condition is that the character makes overlapping contact with a water collision object deployed at the level's origin and covering the entire map. When at least one of the first or second conditions is met, the asynchronous trigger condition is considered satisfied.

[0077] Step S2 (Detection Execution Step): Perform a one-way physical environment sampling only when the asynchronous triggering condition is met: If the first condition is met, perform a capsule ray scan with a search radius of 2 to 3 times the radius of the character's capsule; if the second condition is met, perform a downward straight ray sampling of the terrain height.

[0078] Step S3 (Correction Execution Step): Control the character to move to a safe position based on the sampling results: If it is a lag correction, move the character to an unobstructed walkable point found by the ray via teleportation. If it is not found in one attempt, it can be retried up to 3 times, with an interval of 0.5 seconds each time; If it is a clipping and fall correction, and the character's Z-axis coordinate is less than the terrain height minus 10 engine units of clipping tolerance, then raise the character to a safe height of terrain height plus half the character's height plus 50~100 units of offset, and reset the fall speed component to zero.

[0079] The method further includes: during the stuttering correction, if a new valid user input (input vector magnitude greater than 0.2) is received, the correction step is immediately interrupted; if the ray scan fails multiple times, the correction is abandoned and an error log is output.

[0080] Although the above embodiments are described using Unreal Engine 5 as an example, those skilled in the art will understand that the "asynchronous triggering + one-time sampling" anomaly correction concept proposed in this invention can also be ported to other game engines (such as Unity, CryEngine, etc.), requiring only the implementation of state monitoring, ray detection, and position correction functions. Therefore, any system or method employing the same principle falls within the protection scope of this invention.

[0081] The above embodiments illustrate in detail the specific implementation of the technical solution of the present invention, the logical and connection relationships of each component, and the complete working process. Those skilled in the art will understand that various changes and modifications can be made to the above embodiments without departing from the principles and spirit of the present invention, and all such changes and modifications should fall within the protection scope of the appended claims.

Claims

1. An automatic object state anomaly correction system based on Unreal Engine 5, characterized in that, include: An abnormal trigger monitoring unit is used to monitor preset asynchronous trigger conditions, which include a first condition or a second condition; The detection execution unit, connected to the abnormal trigger monitoring unit, is used to perform a one-way physical environment sampling only when the asynchronous triggering condition is met; as well as A correction execution unit, connected to the detection execution unit, is used to control the character to move to a safe position based on the results of the physical environment sampling. The first condition is that the character's displacement integral within a preset time window is lower than a first threshold and the user's interactive input does not match the character's actual displacement; the second condition is that the character comes into contact with a preset water collision body.

2. The system according to claim 1, characterized in that, Also includes: Art resource preprocessing module, which includes: Terrain markers, set in the terrain assets, are used for physical environment sampling to identify interactive surfaces; as well as The detection rejection component is placed on non-ground structures to reject false positives for legitimate overhang locations.

3. The system according to claim 1, characterized in that, When the asynchronous triggering condition is the first condition: The preset time window is 1 second; The first threshold is when the displacement integral is less than 10 engine units; The mismatch between the user interaction input and the actual displacement of the character includes: the magnitude of the user input vector is greater than 0.2 and the magnitude of the instantaneous velocity of the character is less than 0.05, and the duration of this state exceeds 0.5 seconds.

4. The system according to claim 1, characterized in that, When the asynchronous triggering condition is the first condition: The physical environment sampling performed by the detection execution unit is a capsule-body ray scan, with a search radius of 2 to 3 times the radius of the character's capsule body; The correction execution unit performs a maximum of 3 scan attempts after a single trigger, with an interval of 0.5 seconds between each attempt. If no walkable point is found, the search radius and height are expanded for further searching.

5. The system according to claim 1, characterized in that, When the asynchronous triggering condition is the first condition: When the correction execution unit controls the character's movement, it uses a coordinate setting function with a physical transfer flag to avoid secondary clipping or physical jitter; if a new valid user input is received during the correction execution, the correction process is immediately interrupted.

6. The system according to claim 1, characterized in that, When the asynchronous triggering condition is the second condition: The preset water collider is either an infinite planar collider located at the origin of the level and whose collision range covers the entire map, or a thin box collider with a scaling factor greater than 10,000.

7. The system according to claim 1, characterized in that, When the asynchronous triggering condition is the second condition: The physical environment sampling performed by the detection execution unit is a downward-firing straight ray, used to obtain the actual terrain height of the character's current position; When the character's current Z-axis coordinate is lower than the actual height of the terrain, the correction execution unit will raise the character to a safe height.

8. The system according to claim 7, characterized in that, The correction execution unit is also used to determine before raising the character: the raising is only performed if the character's Z-axis coordinate is less than the actual height of the terrain minus the clipping tolerance (the clipping tolerance is 10 engine units); otherwise, the correction is skipped and the character's normal state is maintained.

9. The system according to claim 7, characterized in that, The safe height is the actual terrain height plus half the character's capsule height plus a vertical offset of 50 to 100 engine units; the correction execution unit resets the character's falling speed component to zero while performing the lift.

10. A method for automatically correcting object state anomalies based on Unreal Engine 5, characterized in that, include: Abnormal trigger monitoring steps: Monitor preset asynchronous trigger conditions, which include a first condition or a second condition. The first condition is that the character's displacement integral within a preset time window is lower than a first threshold and the user interaction input does not match the character's actual displacement. The second condition is that the character comes into contact with a preset water collision body. Detection execution steps: Perform a one-way physical environment sampling only once when the asynchronous triggering condition is met; as well as Corrected execution steps: Based on the results of the physical environment sampling, control the character to move to a safe position.