Lightweight interaction framework implementation method based on UE5 engine

By providing a lightweight interaction framework based on Vue.js in Unreal Engine 5 (UE5), the problems of low interaction efficiency between the front-end and the engine, insufficient real-time performance, and strong coupling of instructions and business logic in UE5 development are solved, and efficient development, cross-project reuse and real-time interaction performance are improved.

CN120066471AActive Publication Date: 2025-05-30THREE-BODY SMART NETWORK TECH (SUZHOU) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510541863.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2025-05-30
Estimated Expiration
2045-04-28

AI Technical Summary

Technical Problem

In the existing Unreal Engine 5 (UE5) development, the interaction between the front-end and the engine is low, the real-time is insufficient, and the instructions and business logic are strongly coupled, making it difficult to achieve cross-project reuse and hot updates.

Method used

It provides a lightweight interactive framework based on UE5 engine, encapsulates UE5 engine functions through Vue.js plug-in, uses standardized instruction sets and WebSocket protocol to achieve low-latency communication, and implements instruction hot updates through yaml configuration files.

Benefits of technology

It significantly improves development efficiency, realizes deep integration of front and back ends and hot instruction updates, improves cross-project reusability and real-time interaction performance, and meets the needs of low-latency communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066471A_ABST
    Figure CN120066471A_ABST
Patent Text Reader

Abstract

The invention relates to a lightweight interaction framework implementation method based on a UE5 engine, which provides a global object this.ue5 through a Vue.js plug-in, encapsulates an API (Application Program Interface) calling interface of a UE5 engine function, and is used for supporting a front end to call the UE5 function through a standardized instruction set, and the standardized instruction set comprises instruction types of scene loading, object control and animation triggering. The development efficiency can be remarkably improved, a front-end framework is deeply integrated, a global object this.ue5 is provided through a Vue.js plug-in, an API calling interface of a UE5 engine function is packaged, automatic generation of front-end and rear-end protocols is achieved, and 80% of interface repeated coding workload is reduced. Through a dynamic instruction extension mechanism, instruction hot update is realized based on a yaml configuration file, an engine does not need to be recompiled when functions are newly added, and the development iteration period is shortened by 60%.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a framework implementation method in the UE5 engine, and particularly to a lightweight interaction framework implementation method based on the UE5 engine. Background Art

[0002] In the existing Unreal Engine 5 (UE5) development, the interaction between the front end and the engine usually relies on traditional HTTP polling or communication schemes based on blueprint scripts. At the same time, the function calls are mainly carried out in the following ways: C++ / Blueprint development mode: Native functions in UE5 need to be developed through C++ code or blueprint scripts. Developers need to be familiar with the underlying architecture of the engine, and the technical threshold is high. At the same time, in the scenario of front-end and back-end separation, an independent HTTP / REST or WebSocket service needs to be built for communication, resulting in a long development cycle and complex maintenance.

[0003] REST API solution: After the back-end service receives the front-end request, it calls UE5 instructions, and the interface and parameter parsing logic need to be developed repeatedly, with high coupling. The real-time performance is poor, and it is difficult to support interaction scenarios that require low latency (such as real-time object control).

[0004] WebSocket communication framework: Although two-way communication can be achieved, it lacks deep integration with front-end frameworks (such as Vue.js), and developers need to manually manage the connection status and data parsing.

[0005] Therefore, the following defects exist: Low development efficiency. The front end and the back end need to synchronously develop communication protocols and functional logics, and function expansion requires repeated coding. Poor reusability. The instructions and business logics are strongly coupled, and it is difficult to reuse across projects. Insufficient real-time performance. The HTTP protocol is difficult to meet the real-time interaction requirements and requires additional optimization.

[0006] At the same time, there is a high-latency bottleneck. The latency of the HTTP protocol generally exceeds 100ms in high-concurrency scenarios, making it difficult to meet the real-time 3D visualization requirements. Moreover, the dynamic expansion ability is insufficient. The instruction set expansion requires recompiling the engine or relying on static configuration files, and runtime hot updates cannot be achieved. In addition, the front-end integration complexity is high. Traditional solutions need to encapsulate interfaces through C++ plugins, resulting in low development efficiency and difficult cross-project reuse.

[0007] In view of the above defects, the inventor actively conducts research and innovation in order to create a lightweight interaction framework implementation method based on the UE5 engine, making it more valuable in the industry. Summary of the Invention

[0008] To solve the above technical problems, the object of the present invention is to provide a lightweight interaction framework implementation method based on the UE5 engine.

[0009] Implementation method of a lightweight interaction framework based on the UE5 engine of the present invention, wherein: Provide the global object this.$ue5 through the Vue.js plugin, encapsulate the API call interface of the UE5 engine function, and support the front end to call the UE5 function through a standardized instruction set. The standardized instruction set includes instruction types for scene loading, object control, and animation triggering. Each instruction needs to include a command_type field and a params parameter object. Through the SHA-256 method, a unique command_id field is generated, which can ensure global uniqueness and avoid instruction conflicts caused by counter overflow or reset. Specifically, after serializing the command_type field and the params parameter object in the instruction, calculate the SHA-256 hash value to generate a 32-byte hexadecimal string as the command_id, which effectively prevents malicious tampering and supports instruction deduplication verification.

[0010] Build a communication protocol layer based on the WebSocket protocol to enable low-latency data transmission between the front end and the UE5 engine. The low latency means that the communication latency in a local area network environment ≤ 50ms. Specifically, the following optimization measures are adopted for the communication protocol layer: (1) Disable the ACK frame: Turn off the confirmation frame by configuring the permessage-deflate extension of the WebSocket protocol to reduce the handshake overhead. (2) Enable TCP_NODELAY: Disable the Nagle algorithm to reduce the transmission latency of small data packets. (3) Data frame compression: Enable the LZ4 compression algorithm for JSON instructions, and the compression rate ≥ 70%. (4) Heartbeat mechanism: Set the heartbeat packet interval to 5 seconds to prevent the connection from timing out and disconnecting.

[0011] Set an instruction parsing layer on the UE5 side to map the JSON format instructions sent by the front end to the internal functions or blueprint nodes of the UE5 engine. The mapping logic includes: After parsing the command_type field, call the pre-registered C++ function. The parameter name matching rule is full-word matching, and convert the JSON format instruction to the FFloatProperty or FIntProperty of UE5 through a type converter. Dynamically register a new instruction set through a configuration file or a hot update mechanism.

[0012] Furthermore, in the above method for implementing a lightweight interaction framework based on the UE5 engine, the global object this.$ue5 supports calling functions such as scene loading, object control, and animation triggering. The object control function includes passing a three-dimensional coordinate displacement vector through the position field, with the vector precision retained to 4 decimal places and the value range being [-1000.0, 1000.0]; passing quaternion rotation parameters through the rotation field, with the quaternion component range limited to [-1.0, 1.0] and the normalization error ≤ 0.001; modifying the object material texture path and transparency value through the material field, with the transparency value range being [0.0, 1.0] and the step precision being 0.01.

[0013] Even further, in the above method for implementing a lightweight interaction framework based on the UE5 engine, the communication protocol layer uses a mixed transmission mode of binary and JSON. The key names in the JSON format follow the Snake Case naming convention, and the key-value nesting depth ≤ 3 levels. Specifically, it includes the following three modes for mixing: 1. Binary mode: When the data volume ≥ 10MB (such as a scene resource package), binary sharding transmission is enabled, with the shard size being 1MB. The header contains fields such as chunk_index (0 - 9999) and total_chunks.

[0014] 2. JSON mode: The key names use snake case naming (such as object_id), and the nesting depth ≤ 3 levels to avoid performance degradation in parsing caused by multi-level nesting.

[0015] 3. Mixed verification: After the sharding transmission is completed, the file integrity is verified through SHA-256. When it fails, an automatic retransmission is triggered (up to three times).

[0016] Even further, in the above method for implementing a lightweight interaction framework based on the UE5 engine, the instruction parsing layer performs the following operations: Parse the front-end instructions and execute the corresponding engine operations, including object rotation, position adjustment, and scene state query. The response mechanism for the scene state query is to collect scene data through the UE5's every 100ms Tick event, and through the differential algorithm, only transmit fields with a change amount ≥ 5%; Push the UE5 engine state to the front-end through the timer mechanism. The trigger interval of the timer is set to 200ms ± 10ms, and the front-end dynamically adjusts it in 50ms steps through the set_interval instruction.

[0017] Furthermore, for the above method for implementing a lightweight interaction framework based on the UE5 engine, the push format of the state is {"event":"Scene.LoadProgress","value":progress value}. If a network interruption occurs, an exception push will be performed, and the content of the exception push is {"event":"Error","code":500,"retry_interval":3}. During implementation, the front end can start a retry mechanism after receiving it.

[0018] Furthermore, for the above method for implementing a lightweight interaction framework based on the UE5 engine, the configuration file is in yaml format, and the save path conforms to the / Config / Commands / *.yaml directory specification. The file descriptor is monitored through epoll for millisecond-level update responses, and the yaml syntax is verified before loading; the configuration file achieves hot update by monitoring the IN_MODIFY event through inotify, with a response delay ≤ 10ms, and the MD5 hash value of the file is verified before loading to ensure integrity.

[0019] Furthermore, for the above method for implementing a lightweight interaction framework based on the UE5 engine, an instruction priority queue is set, high priorities are assigned to object position synchronization instructions and user interaction events, and when high-priority instructions jump the queue, it is required that the command_id hash verification passes; the priority flag is priority=high; the queue-jumping position is limited to the 0th or 1st position backward from the head of the queue.

[0020] Furthermore, for the above method for implementing a lightweight interaction framework based on the UE5 engine, using a virtual reality scene, the attitude data of the headset device is integrated through the OpenXR protocol. The synchronization frequency of the attitude data is 90Hz ± 5Hz, and the quaternion compression algorithm is used for processing. The attitude data can include position, rotation state, etc., which is convenient for tracking the head movement state.

[0021] Furthermore, for the above method for implementing a lightweight interaction framework based on the UE5 engine, the WebSocket plugin is enabled on the UE5 side and the communication port is set. When the default port 8000 is occupied, the ports are switched in the following order. First, 8001, 8003, 8005, 8007, 8009 are preferred; if there is still a conflict, 8002, 8004, 8006, 8008, 8010 are tried. Simply put, the ports are switched in the order of odd numbers first, and if there is still a conflict, even ports are tried. After three consecutive conflicts, the exception code PORT_CONFLICT is triggered and the service is terminated, and the list of conflicting ports is recorded through the log.

[0022] Furthermore, for the above-mentioned method for implementing a lightweight interaction framework based on the UE5 engine, the framework realizes cross-project reuse through modular plugins and business logic; the modular plugins are composed of independent Vue.js plugins encapsulated with UE5 functions, and the business logic is injected into the Vue.js plugins through configuration.

[0023] With the above solution, the present invention has at least the following advantages: 1. Significantly improved development efficiency and deep integration of the front-end framework: By providing the global object this.$ue5 through Vue.js plugins and encapsulating the API call interfaces of the UE5 engine functions, automatic generation of front-end and back-end protocols is realized, reducing the workload of interface duplicate coding by 80%. Through the dynamic instruction extension mechanism, based on the yaml configuration file, instruction hot update is realized. When adding new functions, there is no need to recompile the engine, and the development iteration cycle is shortened by 60%.

[0024] 2. Breakthrough in cross-project reusability. Decoupling of instructions and business logic: Through the design of a standardized instruction set and modular plugins, the code reuse rate is ≥90% during cross-project migration.

[0025] 3. Optimization of real-time interaction performance, meeting low-latency communication, and realizing a hybrid transmission mode.

[0026] 4. High resource utilization rate, reduced bandwidth occupancy, and reduced processing latency of critical instructions.

[0027] The above description is only an overview of the technical solution of the present invention. In order to be able to understand the technical means of the present invention more clearly and implement it in accordance with the content of the specification, the following describes the preferred embodiments of the present invention in detail with reference to the accompanying drawings. Description of the Drawings

[0028] Figure 1 It is a schematic diagram of the construction of a lightweight interaction framework based on the UE5 engine.

[0029] Figure 2 It is a schematic diagram of the instruction call process of a lightweight interaction framework based on the UE5 engine.

[0030] Figure 3 It is a schematic diagram of the selection process of communication ports in a lightweight interaction framework based on the UE5 engine. Detailed Embodiments

[0031] The following combines the accompanying drawings and embodiments to further describe the detailed embodiments of the present invention in detail. The following embodiments are used to illustrate the present invention, but are not used to limit the scope of the present invention.

[0032] As Figures 1 to 3Implementation method of a lightweight interaction framework based on the UE5 engine. What makes it different is that it provides a global object this.$ue5 through a Vue.js plugin, encapsulates the API call interfaces for the functions of the UE5 engine, and is used to support the front-end to call UE5 functions through a standardized instruction set. Specifically, the adopted standardized instruction set includes instruction types for scene loading, object control, and animation triggering. Each instruction needs to include a command_type field and a params parameter object. The unique command_id field can be generated through the SHA-256 hash algorithm, which can ensure global uniqueness and avoid instruction conflicts caused by counter overflow or reset. At the same time, a communication protocol layer is built based on the WebSocket protocol to enable low-latency data transmission between the front-end and the UE5 engine. The low latency is that the communication latency in the local area network environment is ≤50ms. During implementation, a 12-byte header structure can be built, which is a combination of 4-byte message type + 8-byte timestamp. And the transmission efficiency can be improved by disabling algorithms such as ACK frames and TCP_NODELAY.

[0033] Next, an instruction parsing layer is set on the UE5 side to map the JSON-format instructions sent by the front-end to the internal functions or blueprint nodes of the UE5 engine. During implementation, the mapping logic includes: calling the pre-registered C++ function after parsing the command_type field. The parameter name matching rule is full-word matching, and the JSON-format instructions are converted into the FFloatProperty or FIntProperty of UE5 through a type converter. After that, new instruction sets can be dynamically registered through a configuration file or a hot update mechanism.

[0034] Combined with a preferred implementation manner of the present invention, the adopted global object this.$ue5 supports calling functions such as scene loading, object control, and animation triggering. Specifically, the object control function includes passing a three-dimensional coordinate displacement vector through the position field. The vector precision is reserved to 4 decimal places and the value range is [-1000.0, 1000.0]. At the same time, an error code 301 can be returned when the measured value exceeds the range, or it can be other codes for easy intervention and troubleshooting. At the same time, the quaternion rotation parameters are passed through the rotation field. The range of the quaternion components is limited to [-1.0, 1.0] and the normalization error is ≤0.001. During implementation, it can be processed through Gram-Schmidt orthogonalization correction. After that, the object material texture path and transparency value are modified through the material field. The transparency value range is [0.0, 1.0]. And the step precision adopted is 0.01.

[0035] Furthermore, the communication protocol layer adopted by the present invention uses a mixed transmission mode of binary and JSON. When the volume of the transmitted file ≥ 10MB, binary encoding is enabled and the file is transmitted in slices. Specifically, the slicing rule adopted is: the slice size is fixed at 1MB, and the slice serial number is written into the chunk_index field in the JSON header, and its value range is 0 - 9999. After that, the integrity of the file is verified by SHA-256 after the sliced transmission is completed. When the verification fails, a retransmission mechanism is triggered. To improve the integrity of the data, the maximum number of retransmissions can be set to three times. Otherwise, the complete instruction is transmitted in JSON format, and the key names corresponding to the JSON format adopt the Snake Case naming convention, and the nesting depth of the key values ≤ 3 levels.

[0036] In combination with the actual implementation, the adopted instruction parsing layer performs the following operations: parsing the front-end instructions and executing the corresponding engine operations, including object rotation, position adjustment, and scene state query. Specifically, the response mechanism for the scene state query is to collect scene data through the 100ms Tick event of UE5, and through a conventional differential algorithm, only transmit the fields with a change amount ≥ 5%. In this way, the bandwidth occupancy can be reduced. Specifically, the scene state query adopts a differential algorithm based on the Euclidean distance. The position, rotation and other attributes of the scene objects are obtained through the Tick event of UE5 every 100ms to complete the data collection. At the same time, the Euclidean distance difference between the current value and the previous value can be calculated. If the difference ≥ 5% (such as the position change ≥ 0.05 unit), it is marked as a field to be transmitted. Thus, change detection is realized. And it only sends the changed fields, and the bandwidth occupancy can be reduced by 80%. During the implementation, the status of the UE5 engine can be pushed to the front-end through a timer mechanism. The trigger interval of the timer is set to 200ms ± 10ms, and the front-end dynamically adjusts it in 50ms steps through the set_interval instruction. In this way, the CPU occupancy rate can be effectively reduced, and after optimization, the CPU occupancy rate ≤ 5%.

[0037] Considering the convenience of implementation, the push format of the status is: {"event":"Scene.LoadProgress","value":progress value}.

[0038] If a network interruption occurs, an exception push will be made, and the content of the exception push is: {"event":"Error","code":500,"retry_interval":3}.

[0039] During this period, the front-end can start a 3-second countdown after receiving it, automatically attempt to reconnect, and meet the retry logic. At the same time, the error code definition can be realized, and the code field follows the HTTP standard. For example, 500 is a server error, and 404 is an instruction not found.

[0040] Looking further, in order to meet the requirements of easy identification and having a proper standardized configuration format, the configuration file adopted by the present invention is in yaml format. Its storage path conforms to the directory specification of / Config / Commands / *.yaml. In this way, the file descriptors can be monitored by epoll to achieve millisecond-level update responses. Moreover, the yaml syntax can be verified before loading to avoid format errors. At the same time, the configuration file realizes hot update by listening to the IN_MODIFY event through inotify, with a response delay ≤ 10ms, and the MD5 hash value of the file is verified before loading. Thus, integrity can be ensured and data corruption caused by partial writing can be prevented.

[0041] During the implementation of the present invention, an instruction priority queue can be set. In this way, high priorities can be assigned to object position synchronization instructions and user interaction events. Considering the stability of queue jumping, when a high-priority instruction jumps the queue, it is required that the command_id hash verification passes, and the calculation result by SHA-256 is exactly the same as the hash field in the instruction. At the same time, the priority can be marked as priority=high. Furthermore, the queue-jumping position is limited to the 0th or 1st position backward from the head of the queue.

[0042] At the same time, in order to meet the visual data framework, the present invention can utilize a virtual reality scenario to integrate the attitude data of the headset device through the OpenXR protocol. The attitude data synchronization frequency is 90Hz ± 5Hz and is processed using a quaternion compression algorithm. Moreover, in order to optimize and select communication ports, the WebSocket plugin is enabled on the UE5 side and the communication port is set. In this way, when the default port 8000 is occupied, the following order can be tried: 1. Odd ports are preferred: 8001 → 8003 → 8005 → 8007 → 8009.

[0043] 2. Even ports are less optimal: 8002 → 8004 → 8006 → 8008 → 8010.

[0044] 3. Conflict handling: After three consecutive conflicts, the PORT_CONFLICT exception code is triggered and the service is terminated, and the list of conflicting ports is logged. In the log, it can be expressed as, [ERROR] PORT_CONFLICT: All ports 8000-8010 are occupied.

[0045] Furthermore, the framework adopted by the present invention realizes cross-project reuse through modular plug-ins and business logic. Specifically, the implementation method of cross-project reuse is as follows: Through the design of modular plug-ins, the UE5 functions are encapsulated into independent Vue.js plug-ins (this.$ue5), and the business logic can be injected through configuration. At the same time, it can meet the use of standardized instruction sets, decouple the instructions from the business, and only the instruction mapping relationship in the yaml configuration file needs to be modified for the new project. Moreover, it can support hot updates. During implementation, the instructions are dynamically loaded through / Config / Commands / *.yaml without modifying the core code. Furthermore, an interface abstraction layer can be established, and the ICommandHandler interface can be provided. The business logic only needs to implement the interface to adapt to the requirements of different projects.

[0046] The working principle of the present invention is as follows. Combining the lightweight interaction framework disclosed by the present invention with software includes the following content.

[0047] For the generation and transmission of front-end instructions: Scenario, the front end needs to control the position, rotation, and material of an object in the UE5 scenario.

[0048] The logical process includes (1) Instruction construction: The front end calls the sendCommand method through the global object this.$ue5 to construct an instruction object containing the following fields. The parameters involved include command_type, which is used to specify the operation type (such as object_control). Params, which is used to pass specific parameters. Including: object_id, the unique identifier of the target object (such as cube_001). Position, which is used for the three-dimensional coordinate displacement vector (the precision is reserved to 4 decimal places, and the range is limited to [-1000.0, 1000.0]). Rotation, which is used for the quaternion rotation parameter (the component range is limited to [-1.0, 1.0], and the normalization error ≤ 0.001). material, which is used for the material parameter, including the texture path (such as / Game / Textures / Metal_01). The transparency value (the step precision is 0.01, and the range is [0.0, 1.0]).

[0049] (2) Generation of the unique identifier of the instruction: Serialize command_type and params into a JSON string. The SHA-256 algorithm can be used to generate the hash value of this string as the unique command_id (a 32-byte hexadecimal string) to prevent instruction tampering and duplicate submissions.

[0050] (3)WebSocket Transmission Optimization: Disable ACK frames, turn off the permessage-deflate extension of the WebSocket protocol, and reduce handshake overhead. Enable TCP_NODELAY, disable the Nagle algorithm, and reduce the transmission latency of small data packets. Use LZ4 compression to compress JSON instructions with a compression ratio of ≥70%. Adopt a heartbeat mechanism to send heartbeat packets every 5 seconds to maintain the stability of long connections.

[0051] The processing of UE5-side instruction parsing and execution is as follows.

[0052] (1)Instruction reception and parsing. Receive JSON-format instructions through WebSocket on the UE5 side and extract the command_type and params fields. Among them, the parameter verification process involved is as follows: check whether each component of position is within the range of [-1000.0, 1000.0], and return error code 301 if it exceeds, to implement position verification. Correct the rotation parameters by calling FQuat::Normalize() to ensure that the error ≤0.001, meeting the requirements of quaternion normalization. The material path conversion can be realized by converting the string path to the FSoftObjectPath type resource reference of UE5.

[0053] (2)Instruction mapping and execution. Match the pre-registered C++ functions or blueprint nodes according to command_type to achieve function calls. The JSON key names and C++ function parameter names need to be exactly matched word by word, and the numerical types are processed through a type converter (such as converting JSON's number to FFloatProperty) to complete the customization of parameter matching rules.

[0054] The state feedback and exception handling process is as follows.

[0055] (1)State differential push. Collect the properties of scene objects (position, rotation, etc.) every 100ms through the Tick event of UE5 to complete data collection. Calculate the Euclidean distance difference between the current value and the previous value. If the change amount ≥5% (such as the position change ≥0.05 units), mark it as a field to be transmitted to achieve change detection. Only the changed fields are sent throughout the process, reducing the bandwidth occupancy by 80% to meet the needs of incremental transmission.

[0056] (2)Timed state push. Push the scene state to the front end through WebSocket every 200ms (±10ms).

[0057] (3)The exception handling mechanism includes network interruption and front-end retry. Specifically, when a network interruption occurs, an error code is immediately pushed. After receiving the error code, a 3-second countdown is started, and an automatic reconnection attempt is made to achieve front-end retry.

[0058] During the implementation period, the following hot update process can be adopted: Listen for the IN_MODIFY event through inotify, and the response latency ≤ 10 ms. Thus, it can meet the monitoring of file changes. At the same time, after verifying the yaml syntax and MD5 hash value, new instructions are dynamically registered and the configuration is loaded.

[0059] From the above textual description and in combination with the attached drawings, it can be seen that after adopting the present invention, the following advantages are obtained: 1. The development efficiency is significantly improved, and the front-end framework is deeply integrated: By providing the global object this.$ue5 through the Vue.js plugin, the API call interface for encapsulating the UE5 engine functions is implemented, and the front-end and back-end protocols are automatically generated, reducing the interface duplicate coding workload by 80%. Through the dynamic instruction extension mechanism, based on the yaml configuration file, the instruction hot update is realized. When adding new functions, there is no need to recompile the engine, and the development iteration cycle is shortened by 60%.

[0060] 2. The cross-project reusability is broken through. The instructions are decoupled from the business logic: Through the standardized instruction set and modular plugin design, the code reuse rate ≥ 90% during cross-project migration.

[0061] 3. The real-time interaction performance is optimized, meeting low-latency communication, and a hybrid transmission mode can be achieved.

[0062] 4. The resource utilization rate is high, the bandwidth occupancy is reduced, and the processing latency of critical instructions can be reduced.

[0063] The above is only the preferred implementation manner of the present invention and is not used to limit the present invention. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the technical principle of the present invention, several improvements and modifications can still be made, and these improvements and modifications should also be regarded as the protection scope of the present invention.

Claims

1. A lightweight interactive framework implementation method based on UE5 engine, characterized by: The Vue.js plug-in provides a global object this.$ue5, which encapsulates the API calling interface of the UE5 engine function, and is used to support the front-end to call the UE5 function through a standardized instruction set. The standardized instruction set includes instruction types for scene loading, object control, and animation triggering. Each instruction must include a command_type field and a params parameter object. A unique command_id field is generated through SHA-256. Building a communication protocol layer based on the WebSocket protocol enables low-latency data transmission between the front end and the UE5 engine. The low latency is that the communication delay in a local area network environment is ≤50ms. Set up the command parsing layer on the UE5 side to map the JSON format commands sent by the front end to the internal functions or blueprint nodes of the UE5 engine. The mapping logic includes: parsing the command_type field and calling the pre-registered C++ function, the parameter name matching rule is full word matching, and the JSON format command is converted into UE5's FFloatProperty or FIntProperty through a type converter; Dynamically register new instruction sets through configuration files or hot update mechanisms.

2. The method for implementing a lightweight interactive framework based on the UE5 engine according to claim 1, characterized in that: The global object this.$ue5 supports calling scene loading, object control and animation triggering functions. The object control function includes transmitting the three-dimensional coordinate displacement vector through the position field, with the vector precision retained to 4 decimal places and the value range being [-1000.0, 1000.0]; The quaternion rotation parameters are passed through the rotation field. The quaternion component range is limited to [-1.0, 1.0] and the normalized error is ≤ 0.

001. Modify the object material texture path and transparency value through the material field. The transparency value range is [0.0, 1.0] and the step precision is 0.

01.

3. The method for implementing a lightweight interactive framework based on the UE5 engine according to claim 1, characterized in that: The communication protocol layer adopts a binary and JSON mixed transmission mode, the key name corresponding to the JSON format adopts the Snake Case naming specification, and the key value nesting depth is ≤3 layers.

4. The method for implementing a lightweight interactive framework based on the UE5 engine according to claim 1, characterized in that: The instruction parsing layer performs the following operations: Parse front-end instructions and execute corresponding engine operations, including object rotation, position adjustment, and scene status query. The response mechanism of the scene status query is to collect scene data through the UE5's Tick event every 100ms, and transmit only the fields with a change of ≥5% through a differential algorithm; The UE5 engine status is pushed to the front end through a timer mechanism. The trigger interval of the timer is set to 200ms±10ms, and the front end dynamically adjusts it in 50ms steps through the set_interval instruction.

5. The method for implementing a lightweight interactive framework based on the UE5 engine according to claim 4, characterized in that: The push format of the status is {"event":"Scene.LoadProgress","value":progress value}. If a network interruption occurs, an abnormal push is performed, and the content of the abnormal push is {"event":"Error","code":500,"retry_interval":3}.

6. The method for implementing a lightweight interactive framework based on the UE5 engine according to claim 1, characterized in that: The configuration file is in yaml format, the saving path complies with the / Config / Commands / *.yaml directory specification, the file descriptor is listened to by epoll for update response, and the yaml syntax is verified before loading; the configuration file is listened to by inotify for IN_MODIFY events to achieve hot update, the response delay is ≤10ms, and the file MD5 hash value is verified before loading.

7. The method for implementing a lightweight interactive framework based on the UE5 engine according to claim 1, characterized in that: Set the command priority queue, assign high priority to object position synchronization commands and user interaction events, and high priority commands must pass the command_id hash check when they are queued; the priority mark is priority=high; the queue insertion position is limited to the 0th or 1st position backward from the head of the queue.

8. The method for implementing a lightweight interactive framework based on the UE5 engine according to claim 1, characterized in that: Utilizing the virtual reality scene, the head display device posture data is integrated through the OpenXR protocol. The posture data synchronization frequency is 90Hz±5Hz and is processed using a quaternion compression algorithm.

9. The method for implementing a lightweight interactive framework based on the UE5 engine according to claim 1, characterized in that: The UE5 enables the WebSocket plug-in and sets the communication port. When the default port 8000 is occupied, the port is switched in the following order, with 8001, 8003, 8005, 8007, and 8009 being given priority; if there is still a conflict, try 8002, 8004, 8006, 8008, and 8010; after three consecutive conflicts, the exception code PORT_CONFLICT is triggered and the service is terminated.

10. The method for implementing a lightweight interactive framework based on the UE5 engine according to claim 1, characterized in that: The framework achieves cross-project reuse through modular plug-ins and business logic; The modular plug-in is composed of an independent Vue.js plug-in encapsulated with UE5 functions, and the business logic is injected into the Vue.js plug-in through configuration.

Citation Information

Patent Citations

  • Network communication encoding and decoding engine method for satellite receiving system based on XML and JSON

    CN112612535A

  • Digital twin application interaction system and method based on instruction protocol

    CN117033034A

  • System and method for integrated header, state, rate and content anomaly prevention with policy enforcement

    US20060133377A1