Method and system for interaction between virtual characters and scenes in a room escape type game
Patent Information
- Application Number
- CN202611108370.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-24
- Publication Date
- 2026-09-25
AI Technical Summary
多数游戏的解谜交互流程完全依靠C#脚本硬编码实现,通过if-else、switch-case等条件语句逐一对场景内各交互物件编写专属交互逻辑,这种开发方式使得交互代码与游戏场景、交互物体深度紧耦合,无法实现交互逻辑的可视化、配置化编辑;在新增游戏场景、拓展交互机关或迭代解谜玩法时,开发人员需重复编写大量冗余代码,存在逻辑复用率低、开发迭代周期长、维护成本高昂等问题
[0020]本申请的有益效果:实现了通过构建条件节点链与动作节点链双层配置化交互架构,能够实现交互逻辑在不同交互物体、不同场景中复用,无需重复编写相似逻辑,有效降低开发成本。通过自动检测并切换键盘/鼠标与手柄模式,使同一套代码无需修改即可同时适配PC与主机平台。通过采用分层距离判定策略结合方向加权最近邻焦点导航算法,使玩家能够通过鼠标、手柄、纯键盘等各类设备精准选取场景交互物体,有效提升游戏的真实感与沉浸感。通过将交互物体的光标类型属性与交互联动,可在交互范围内同步切换光标纹理与Shader高亮描边宽度,形成直观的交互提示,有效提高用户游戏体验。
Smart Images

Figure CN122806068A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of virtual interaction technology, and in particular to a method and system for interaction between virtual characters and scenes in escape room games. Background Technology
[0002] Currently, most 2D escape room games, both domestically and internationally, are developed using commercial game engines such as Unity. The development of puzzle-solving interactions in these games generally employs basic technical models such as hard-coded scripts, simple event binding in editors, traditional finite state machines, and native input reading. The puzzle-solving interaction flow in most games relies entirely on hard-coded C# scripts, using conditional statements like if-else and switch-case to write custom interaction logic for each interactive object in the scene. This development approach results in a deep and tight coupling between the interaction code and the game scene and interactive objects, making it impossible to visualize or configurably edit the interaction logic. When adding new game scenes, expanding interactive mechanisms, or iterating puzzle-solving gameplay, developers need to repeatedly write a large amount of redundant code, leading to low logic reusability, long development iteration cycles, and high maintenance costs.
[0003] Furthermore, some development solutions rely on UnityEvent from Unity Inspector for simple event binding, which can only complete a single trigger execution mapping relationship and cannot adapt to complex puzzle interaction scenarios involving multiple compound conditions, multi-level action chains, and success and failure branches. Other solutions use traditional finite state machines to manage object interaction states, but traditional finite state machines only support enumerated type state transition conditions and cannot flexibly implement multi-dimensional compound judgments such as numerical comparison, numerical range determination, and item ownership verification. At the same time, their output actions are limited to basic state switching and are difficult to drive diverse interactive actions such as animation playback, camera switching, scene loading, and screen transitions. Summary of the Invention
[0004] To overcome the shortcomings of existing technologies, this invention provides a method and system for interaction between virtual characters and scenes in escape room games. It achieves a two-layer configurable interaction architecture by constructing conditional node chains and action node chains, enabling the reuse of interaction logic across different interactive objects and scenes without repeatedly writing similar logic, effectively reducing development costs. By automatically detecting and switching between keyboard / mouse and gamepad modes, the same code can be adapted to both PC and console platforms without modification. By employing a layered distance determination strategy combined with a direction-weighted nearest neighbor focus navigation algorithm, players can accurately select interactive objects in the scene using various devices such as mice, gamepads, and keyboards, effectively enhancing the game's realism and immersion. By linking the cursor type attribute of interactive objects with the interaction, the cursor texture and shader highlight outline width can be switched synchronously within the interaction range, forming intuitive interaction prompts and effectively improving the user's gaming experience.
[0005] To achieve the above-mentioned objectives, the present invention adopts the following technical solution:
[0006] The first aspect of this application provides a method for interaction between virtual characters and scenes in escape room games, including the following steps: S101. Construct a two-layer configurable interaction architecture consisting of a condition node chain and an action node chain; wherein, the condition node chain is used to define the multi-dimensional composite conditions on which the interaction between the virtual character and objects in the game scene depends, and the action node chain is used to execute an interactive action sequence containing Tween animation and asynchronous callback after the multi-dimensional composite conditions are met. S102. Obtain user operation command data, determine interactive objects based on hierarchical distance determination strategy, or based on direction weighted nearest neighbor focus navigation algorithm, apply directional weights to candidate interactive objects according to the virtual character's orientation, and select the object with the smallest weighted distance as the interactive object. S103. Based on the multi-mode fusion collision interaction triggering strategy, perform interaction verification and implement cooldown time control for interactive objects. When the interaction verification is met, the trigger condition node chain is executed. Among them, the multi-mode fusion collision interaction triggering strategy includes pure collision interaction triggering mode, collision and directional button combined interaction triggering mode, collision and condition combined interaction triggering mode, one-time interaction triggering mode and drag-and-drop prop interaction triggering mode. S104. Based on 2D ray detection and shader highlighting technology, the cursor type is switched and outline highlighting is performed on interactive objects to generate a visual interactive cursor shape that can distinguish different interactive functions.
[0007] Furthermore, a two-layer configurable interaction architecture consisting of a condition node chain and an action node chain is constructed. The condition node chain defines the multi-dimensional composite conditions upon which the interaction between the virtual character and objects in the game scene depends, while the action node chain executes an interactive action sequence containing Tween animations and asynchronous callbacks after the multi-dimensional composite conditions are met. This sequence includes the following steps: Configure at least one multi-dimensional composite condition in the condition node chain. The multi-dimensional composite condition includes item existence judgment and state value calculation judgment. Item existence judgment includes whether the target item exists or not. State value calculation judgment includes four types of comparison operations: equal to, not equal to, greater than, and less than. When the multi-dimensional composite condition judgment result is met, the action node chain is triggered to contain an interactive action sequence of Tween animation and asynchronous callback; the interactive action sequence includes actions to show or hide objects, position transformation, rotation transformation, picking up items, playing animation, camera switching, scene switching, and playing text. A camera dictionary is built based on the scene's unique identifier and the camera's position coordinates. The camera dictionary is used to store the current camera position before scene switching and to restore the camera position after scene rollback. When performing an interactive action that includes a Tween animation, the game input is locked, and the next interactive action is triggered in the Tween animation completion callback.
[0008] Furthermore, obtaining user operation command data includes the following steps: The system detects the joystick axis value or the press status of the gamepad function keys. If the absolute value of the joystick axis exceeds the dead zone, or if a press signal is detected on a gamepad function key, the current operation mode is switched to gamepad control mode. Otherwise, the system detects the press status of any keyboard key or the left / right mouse button. If a press signal is detected, the current operation mode is switched to keyboard and mouse control mode.
[0009] Furthermore, determining interactive objects based on a hierarchical distance determination strategy includes the following steps: The system determines whether to execute a double-click callback based on the number of mouse double-clicks, and uses 2D raycasting technology to detect the scene and interactive objects the mouse is pointing at. Branching is then performed based on the determination of the scene and interactive objects hit by the raycast. When the ray hits an interactive object, if the mouse click position is within the direct interaction range, clicking the interactive object will trigger the interaction verification. If the mouse click location is within the interaction prompt area and the interactive object has an interactive point, clicking the interactive object will trigger the virtual character to automatically navigate to the preset interactive point; If the mouse click location is outside the interactive prompt range, the virtual character will be triggered to move to the scene coordinates corresponding to the mouse click. If the current scene is in sub-scene mode, clicking on the interactive object will trigger the interaction verification. When the ray misses an interactive object, the virtual character is triggered to move to the scene coordinates corresponding to the mouse click.
[0010] Furthermore, based on the direction-weighted nearest neighbor focus navigation algorithm, the method of applying directional weights to candidate interactive objects according to the virtual character's orientation and selecting the object with the smallest weighted distance as the interactive object includes the following steps: Get all interactive objects in the scene, calculate the camera's view frustum plane, retain only the candidate interactive objects within the field of view, and sort them by World coordinates; When a directional key press signal is detected, the vector from the currently focused interactive object to each candidate interactive object is calculated, as well as the normalized dot product of the vector and the direction vector is calculated. Candidate interactive objects whose dot product is not less than a preset dot product threshold are then scored using a distance-weighted method, and the candidate interactive object with the lowest score is selected as the next interactive object: score = distance / (dot + 0.1) Where score is the rating of the candidate interactive object, distance is the distance between the currently focused interactive object and the candidate interactive object, and dot is the normalized vector dot product.
[0011] Furthermore, interaction verification is performed based on a multi-mode fusion collision interaction triggering strategy, and cooldown time control is implemented for interactive objects. When the interaction verification is met, the trigger condition node chain is executed. The multi-mode fusion collision interaction triggering strategy includes a pure collision interaction triggering mode, a collision and directional button combined interaction triggering mode, a collision and condition combined interaction triggering mode, a one-time interaction triggering mode, and a drag-and-drop prop interaction triggering mode, which includes the following steps: If it is a pure collision interaction trigger mode, then check whether the virtual character has entered the collision trigger area and meets the cooldown time condition. When the check is met, the trigger condition node chain is executed. If the interaction is triggered by a combination of collision and directional keys, then it checks whether the virtual character has entered the collision zone and meets the cooldown time condition, and whether the keyboard directional key press signal is detected. When the checks are met, the trigger condition node chain is executed. If it is a collision and condition-based interactive trigger mode, then check whether the virtual character has entered the collision trigger area and meets the cooldown time condition, and check whether other item / state conditions are met. When the checks are met, the trigger condition node chain is executed. If it is a one-time interaction trigger mode, the hash set of triggered interaction objects is retrieved. If the interaction object identifier does not exist, the trigger condition node chain is executed, and the interaction object identifier is stored in the hash set of triggered interaction objects. If the interaction is triggered by dragging and dropping items, the dragged items are matched and verified based on the list of interactive objects. When the matching verification is met, the trigger condition node chain is executed. After the interaction is successful, it is determined whether to reduce the item's current durability. When the durability reaches zero, the item is automatically removed from the inventory.
[0012] Furthermore, based on 2D ray detection and shader highlighting technology, cursor type switching and outline highlighting are performed on interactive objects to generate visual interactive cursor shapes that can distinguish different interactive functions, including the following steps: The scene and interactive objects pointed to by the mouse are detected using 2D ray detection technology, and branch processing is performed based on the determination results of the scene and interactive objects hit by the ray. When a ray hits an interactive object, if the mouse is within the interactive tooltip area or in sub-scene mode, the cursor type of the interactive object is switched to the specified cursor, and the interactive object is outlined and highlighted using Shader highlighting technology. If the ray misses the interactive object or the mouse moves out of the interactive tooltip area, the cursor type of the interactive object will be switched to the original cursor and the stroke highlight will be cleared.
[0013] The second aspect of this application provides an interaction system between virtual characters and scenes in escape room games, including: The two-layer configurable interaction architecture management module is used to construct a two-layer configurable interaction architecture consisting of a condition node chain and an action node chain. The condition node chain is used to define the multi-dimensional composite conditions on which the interaction between the virtual character and objects in the game scene depends, and the action node chain is used to execute an interactive action sequence containing Tween animations and asynchronous callbacks after the multi-dimensional composite conditions are met. The multimodal input adaptation module is used to acquire user operation command data, determine interactive objects based on a hierarchical distance determination strategy, or apply directional weights to candidate interactive objects according to the virtual character's orientation based on a direction-weighted nearest neighbor focus navigation algorithm, and select the object with the smallest weighted distance as the interactive object. The multi-mode interaction trigger management module is used to perform interaction verification based on the multi-mode fusion collision interaction trigger strategy and to control the cooldown time of interactive objects. When the interaction verification is met, the trigger condition node chain is executed. The multi-mode fusion collision interaction trigger strategy includes pure collision interaction trigger mode, collision and directional button combined interaction trigger mode, collision and condition combined interaction trigger mode, one-time interaction trigger mode, and drag-and-drop prop interaction trigger mode. The context-aware cursor module is used to switch cursor types and outline highlighting of interactive objects based on 2D ray detection and shader highlighting technology, generating visual interactive cursor shapes that can distinguish different interactive functions.
[0014] Furthermore, the two-layer configurable interaction architecture management module is used to construct a two-layer configurable interaction architecture composed of a condition node chain and an action node chain. The condition node chain defines the multi-dimensional composite conditions upon which the interaction between the virtual character and objects in the game scene depends, while the action node chain executes a sequence of interactive actions, including Tween animations and asynchronous callbacks, after the multi-dimensional composite conditions are met. Configure at least one multi-dimensional composite condition in the condition node chain. The multi-dimensional composite condition includes item existence judgment and state value calculation judgment. Item existence judgment includes whether the target item exists or not. State value calculation judgment includes four types of comparison operations: equal to, not equal to, greater than, and less than. When the multi-dimensional composite condition judgment result is met, the action node chain is triggered to contain an interactive action sequence of Tween animation and asynchronous callback; the interactive action sequence includes actions to show or hide objects, position transformation, rotation transformation, picking up items, playing animation, camera switching, scene switching, and playing text. A camera dictionary is built based on the scene's unique identifier and the camera's position coordinates. The camera dictionary is used to store the current camera position before scene switching and to restore the camera position after scene rollback. When performing an interactive action that includes a Tween animation, the game input is locked, and the next interactive action is triggered in the Tween animation completion callback.
[0015] Furthermore, in the multimodal input adaptation module, the acquisition of user operation command data includes: The system detects the joystick axis value or the press status of the gamepad function keys. If the absolute value of the joystick axis exceeds the dead zone, or if a press signal is detected on a gamepad function key, the current operation mode is switched to gamepad control mode. Otherwise, the system detects the press status of any keyboard key or the left / right mouse button. If a press signal is detected, the current operation mode is switched to keyboard and mouse control mode.
[0016] Furthermore, in the multimodal input adaptation module, the interactive objects determined based on the hierarchical distance determination strategy include: The system determines whether to execute a double-click callback based on the number of mouse double-clicks, and uses 2D raycasting technology to detect the scene and interactive objects the mouse is pointing at. Branching is then performed based on the determination of the scene and interactive objects hit by the raycast. When the ray hits an interactive object, if the mouse click position is within the direct interaction range, clicking the interactive object will trigger the interaction verification. If the mouse click location is within the interaction prompt area and the interactive object has an interactive point, clicking the interactive object will trigger the virtual character to automatically navigate to the preset interactive point; If the mouse click location is outside the interactive prompt range, the virtual character will be triggered to move to the scene coordinates corresponding to the mouse click. If the current scene is in sub-scene mode, clicking on the interactive object will trigger the interaction verification. When the ray misses an interactive object, the virtual character is triggered to move to the scene coordinates corresponding to the mouse click.
[0017] Furthermore, in the multimodal input adaptation module, based on the direction-weighted nearest neighbor focus navigation algorithm, directional weights are applied to candidate interactive objects according to the virtual character's orientation, and the object with the smallest weighted distance is selected as the interactive object, including: Get all interactive objects in the scene, calculate the camera's view frustum plane, retain only the candidate interactive objects within the field of view, and sort them by World coordinates; When a directional key press signal is detected, the vector from the current focused interactive object to each candidate interactive object is calculated, as well as the dot product of the vector and the normalized directional vector is calculated. The candidate interactive objects whose dot product is not less than a preset dot product threshold are given a distance-weighted score, and the candidate interactive object with the smallest score is selected as the next interactive object.
[0018] Furthermore, the multi-mode interaction trigger management module is used to perform interaction verification based on the multi-mode fusion collision interaction trigger strategy and to control the cooldown time of interactive objects. When the interaction verification is met, the trigger condition node chain is executed. The multi-mode fusion collision interaction trigger strategy includes pure collision interaction trigger mode, collision and directional button combined interaction trigger mode, collision and condition combined interaction trigger mode, one-time interaction trigger mode, and drag-and-drop prop interaction trigger mode. If it is a pure collision interaction trigger mode, then check whether the virtual character has entered the collision trigger area and meets the cooldown time condition. When the check is met, the trigger condition node chain is executed. If the interaction is triggered by a combination of collision and directional keys, then it checks whether the virtual character has entered the collision zone and meets the cooldown time condition, and whether the keyboard directional key press signal is detected. When the checks are met, the trigger condition node chain is executed. If it is a collision and condition-based interactive trigger mode, then check whether the virtual character has entered the collision trigger area and meets the cooldown time condition, and check whether other item / state conditions are met. When the checks are met, the trigger condition node chain is executed. If it is a one-time interaction trigger mode, the hash set of triggered interaction objects is retrieved. If the interaction object identifier does not exist, the trigger condition node chain is executed, and the interaction object identifier is stored in the hash set of triggered interaction objects. If the interaction is triggered by dragging and dropping items, the dragged items are matched and verified based on the list of interactive objects. When the matching verification is met, the trigger condition node chain is executed. After the interaction is successful, it is determined whether to reduce the item's current durability. When the durability reaches zero, the item is automatically removed from the inventory.
[0019] Furthermore, the context-aware cursor module is used to switch cursor types and apply outline highlighting to interactive objects based on 2D ray detection and shader highlighting technology, generating visual interactive cursor forms that can distinguish different interactive functions, including: The scene and interactive objects pointed to by the mouse are detected using 2D ray detection technology, and branch processing is performed based on the determination results of the scene and interactive objects hit by the ray. When a ray hits an interactive object, if the mouse is within the interactive tooltip area or in sub-scene mode, the cursor type of the interactive object is switched to the specified cursor, and the interactive object is outlined and highlighted using Shader highlighting technology. If the ray misses the interactive object or the mouse moves out of the interactive tooltip area, the cursor type of the interactive object will be switched to the original cursor and the stroke highlight will be cleared.
[0020] The beneficial effects of this application are as follows: It achieves a two-layer configurable interaction architecture by constructing condition node chains and action node chains, enabling the reuse of interaction logic across different interactive objects and scenes without repeatedly writing similar logic, effectively reducing development costs. By automatically detecting and switching between keyboard / mouse and gamepad modes, the same code can be adapted to both PC and console platforms without modification. By employing a layered distance determination strategy combined with a direction-weighted nearest neighbor focus navigation algorithm, players can accurately select interactive objects in the scene using various devices such as mice, gamepads, and keyboards, effectively enhancing the realism and immersion of the game. By linking the cursor type attribute of the interactive object with the interaction, the cursor texture and shader highlight outline width can be switched synchronously within the interaction range, forming intuitive interaction prompts and effectively improving the user's gaming experience. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic diagram illustrating the steps of the method for interaction between virtual characters and scenes in escape room games according to the present invention. Detailed Implementation
[0023] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0024] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0025] Example 1 The first aspect of this application provides a method for interaction between virtual characters and scenes in escape room games, including the following steps: S101. Construct a two-layer configurable interaction architecture consisting of a condition node chain and an action node chain. The condition node chain is used to define the multi-dimensional composite conditions on which the interaction between the virtual character and objects in the game scene depends, and the action node chain is used to execute an interactive action sequence containing Tween animation and asynchronous callback after the multi-dimensional composite conditions are met.
[0026] This step fundamentally solves the problem of deep coupling between interaction logic and scene by configuring a two-layer configurable architecture of "condition node chain + action node chain". Specifically, by abstracting the interaction rules that were originally hard-coded in the program script into an editable data structure, interactive objects define all possible interactive behaviors through a list, and each interactive behavior declares trigger conditions (including item ownership status and game state values) through a condition list. The specific action sequence is referenced by judging whether the operation is successful. This allows designers to directly configure the interaction logic through a visual editor, creating and modifying complex game interaction scenes without modifying and recompiling the code. This achieves complete decoupling between interaction logic and game scene, improving development efficiency while reducing maintenance costs.
[0027] Specifically, an interaction object model containing an interaction list is established. Each interaction item includes a condition list, a list of actions to be executed when the condition is met, and a list of actions to be executed when the condition is not met. This data structure configuration replaces traditional hard-coded logic. The condition node chain configures item conditions (supporting both isItem and notItem modes) and state conditions (supporting four modes: equal, unequal, greater than, and less than). The action node chain configures an ordered list of actions containing multiple action steps. In the condition judgment process, the condition list of the interaction item is traversed to perform a backpack containment check on the item conditions. The isItem mode checks whether the backpack contains the specified item, and the notItem mode checks whether the backpack does not contain the specified item. That is, when the condition is an item type, a forward or reverse check is performed based on the virtual character's backpack. For state conditions, numerical comparisons are performed (e.g., equal, unequal, greater than, and less than). That is, when the condition is a state type, the current global state value is compared with the required value. When all conditions are met, the process is considered successful and the action node chain is triggered. The action node chain is executed in a fixed order. For actions involving Tween animations, such as position transformations and rotation transformations, players are prohibited from performing any input operations during the animation process to prevent accidental operations from disrupting the game state. The animation is automatically unlocked after completion, and the next action node is triggered in the callback function after the animation is completed. This achieves chained asynchronous nested calls between actions, allowing the complex process of "playing animation → waiting for completion → executing the next action" to be seamlessly connected. This ensures both the smoothness of the visual presentation and the rigor of the game logic, effectively solving the technical defects of actions not being able to wait and nested calls under synchronous execution.
[0028] A two-layer configurable interaction architecture consisting of a condition node chain and an action node chain is constructed. The condition node chain defines the multi-dimensional composite conditions upon which the interaction between the virtual character and objects in the game scene depends, while the action node chain executes an interactive action sequence containing Tween animations and asynchronous callbacks after the multi-dimensional composite conditions are met. This includes the following steps: Configure at least one multi-dimensional composite condition in the condition node chain. The multi-dimensional composite condition includes item existence judgment and state value calculation judgment. Item existence judgment includes whether the target item exists or not. State value calculation judgment includes four types of comparison operations: equal to, not equal to, greater than, and less than. When the multi-dimensional composite condition judgment result is met, the action node chain is triggered to contain an interactive action sequence of Tween animation and asynchronous callback; the interactive action sequence includes actions to show or hide objects, position transformation, rotation transformation, picking up items, playing animation, camera switching, scene switching, and playing text. A camera dictionary is built based on the scene's unique identifier and the camera's position coordinates. The camera dictionary is used to store the current camera position before scene switching and to restore the camera position after scene rollback. When performing an interactive action that includes a Tween animation, the game input is locked, and the next interactive action is triggered in the Tween animation completion callback.
[0029] For example, in a game, create a "locked treasure chest" interactive object. The design requirement is that the player must possess the "golden key" item and have a game progress status value greater than or equal to 5 to successfully open the treasure chest and obtain the item. In the process of executing the action node chain, first, the action of playing the treasure chest opening animation is executed, then the action of picking up the "ancient scroll" inside the treasure chest is executed to add it to the virtual character's inventory and hide the treasure chest, and finally, the action of displaying the prompt text "Obtained Ancient Scroll" is executed. If the player does not have the golden key or the game progress status value is 3, the condition judgment fails, and the action of executing the prompt text "Cannot open" is displayed.
[0030] S102. Obtain user operation command data, determine interactive objects based on hierarchical distance determination strategy, or apply directional weights to candidate interactive objects according to the virtual character's orientation based on the direction weighted nearest neighbor focus navigation algorithm, and select the object with the smallest weighted distance as the interactive object.
[0031] This step enables automatic detection and switching between keyboard / mouse and gamepad modes, allowing the same code to support both PC and console platforms without modification, solving the problem of fixed input modes or the need for manual switching in existing technologies. A layered distance judgment strategy divides the distance between the mouse and interactive objects into three levels: direct interaction range, interaction prompt range, and beyond range. These are used to trigger three different behaviors: direct interaction, automatic navigation of the virtual character to a preset interaction point, and movement of the virtual character to the scene coordinates corresponding to the mouse click. This precisely controls the interaction between the virtual character and interactive objects, effectively enhancing the realism and immersion of the game. A direction-weighted nearest neighbor focus navigation algorithm enables mouse-free devices (gamepad or keyboard only) to accurately select interactive objects in the scene. Through direction vector dot product filtering and distance-weighted scoring, it can select objects that are roughly in the same direction and relatively close when the player presses the directional keys. This effectively avoids misfocusing caused by simple nearest-distance selection, such as selecting an object behind instead of in front, greatly improving the gaming experience for mouse-free devices.
[0032] Obtaining user operation command data includes the following steps: The system detects the joystick axis value or the press status of the gamepad function keys. If the absolute value of the joystick axis exceeds the dead zone, or if a press signal is detected on a gamepad function key, the current operation mode is switched to gamepad control mode. Otherwise, the system detects the press status of any keyboard key or the left / right mouse button. If a press signal is detected, the current operation mode is switched to keyboard and mouse control mode.
[0033] Determining interactive objects based on a hierarchical distance determination strategy includes the following steps: The system determines whether to execute a double-click callback based on the number of mouse double-clicks, and uses 2D raycasting technology to detect the scene and interactive objects the mouse is pointing at. Branching is then performed based on the determination of the scene and interactive objects hit by the raycast. When the ray hits an interactive object, if the mouse click position is within the direct interaction range, clicking the interactive object will trigger the interaction verification. If the mouse click location is within the interaction prompt area and the interactive object has an interactive point, clicking the interactive object will trigger the virtual character to automatically navigate to the preset interactive point; If the mouse click location is outside the interactive prompt range, the virtual character will be triggered to move to the scene coordinates corresponding to the mouse click. If the current scene is in sub-scene mode, clicking on the interactive object will trigger the interaction verification. When the ray misses an interactive object, the virtual character is triggered to move to the scene coordinates corresponding to the mouse click.
[0034] For example, if a player controls a virtual character standing in the center of a room and clicks the mouse outside the area indicated by the treasure chest interaction prompt, the virtual character will begin to move towards the treasure chest. When the virtual character moves near the treasure chest, clicking again within the area indicated by the treasure chest interaction prompt will automatically navigate the virtual character to a preset interaction point next to the treasure chest (such as directly in front of the treasure chest). When the virtual character reaches the interaction point, clicking again will directly trigger the interaction verification, check if it is within the cooldown period and trigger a conditional judgment, then check if the player has the key and execute the opening action.
[0035] Based on the orientation-weighted nearest neighbor focus navigation algorithm, the process of applying orientation weights to candidate interactive objects according to the virtual character's orientation and selecting the object with the smallest weighted distance as the interactive object includes the following steps: Get all interactive objects in the scene, calculate the camera's view frustum plane, retain only the candidate interactive objects within the field of view, and sort them by World coordinates; When a directional key press signal is detected, the vector from the currently focused interactive object to each candidate interactive object is calculated, as well as the normalized dot product of the vector and the direction vector is calculated. Candidate interactive objects whose dot product is not less than a preset dot product threshold are then scored using a distance-weighted method, and the candidate interactive object with the lowest score is selected as the next interactive object: score = distance / (dot + 0.1) Where score is the rating of the candidate interactive object, distance is the distance between the currently focused interactive object and the candidate interactive object, and dot is the normalized vector dot product.
[0036] For example, a player is using a controller, and the current focus is on the bookshelf on the left. The player presses the right arrow key, and the following calculations are made: the table on the right is 2 meters away, the dot product of the direction vector and the right direction is 0.95, so the score is 2 / (0.95+0.1)=1.90; the vase in front to the right is 1.5 meters away, the dot product is 0.8, so the score is 1.5 / (0.8+0.1)=1.67; the chair behind to the right is 1 meter away, the dot product is -0.5. Based on these score results, the vase with the lower score is selected as the new interactive object, rather than the chair which is closer but has the wrong direction, or the table which is farther away.
[0037] S103. Based on the multi-mode fusion collision interaction triggering strategy, perform interaction verification and implement cooldown time control for interactive objects. When the interaction verification is met, the trigger condition node chain is executed. Among them, the multi-mode fusion collision interaction triggering strategy includes pure collision interaction triggering mode, collision and directional button combined interaction triggering mode, collision and condition combined interaction triggering mode, one-time interaction triggering mode and drag-and-drop prop interaction triggering mode.
[0038] This step supports the integration of multiple triggering strategies on the same interactive object, enabling diversified and refined control of triggering methods. Existing technologies typically only support a choice between click triggering and collision triggering, while this mechanism allows for a composite triggering logic of "approaching the door (collision) and pressing the up arrow key to open the door." At the same time, a cooldown timer prevents logical errors caused by continuous triggering, and a one-time interaction trigger ensures that key plot events do not repeat, providing richer interactive design possibilities for escape room games.
[0039] For example, design a "mechanical staircase": if a virtual character enters the staircase collision area and presses an arrow key on the keyboard, and more than 2 seconds have passed since the last trigger, and the staircase has not been triggered before, then the trigger condition is checked to see if the character possesses a "staircase key." If successful, the character will perform the action of going upstairs. If the virtual character merely enters the collision area without pressing an arrow key, or is in a cooldown period, no interaction will be triggered.
[0040] Interaction verification is performed based on a multi-mode fusion collision interaction triggering strategy, and a cooldown time is controlled for interactive objects. When the interaction verification is met, the trigger condition node chain is executed. The multi-mode fusion collision interaction triggering strategy includes a pure collision interaction triggering mode, a collision and directional button combined interaction triggering mode, a collision and condition combined interaction triggering mode, a one-time interaction triggering mode, and a drag-and-drop prop interaction triggering mode, which includes the following steps: If it is a pure collision interaction trigger mode, then check whether the virtual character has entered the collision trigger area and meets the cooldown time condition. When the check is met, the trigger condition node chain is executed. If the interaction is triggered by a combination of collision and directional keys, then it checks whether the virtual character has entered the collision zone and meets the cooldown time condition, and whether the keyboard directional key press signal is detected. When the checks are met, the trigger condition node chain is executed. If it is a collision and condition-based interactive trigger mode, then check whether the virtual character has entered the collision trigger area and meets the cooldown time condition, and check whether other item / state conditions are met. When the checks are met, the trigger condition node chain is executed. If it is a one-time interaction trigger mode, the hash set of triggered interaction objects is retrieved. If the interaction object identifier does not exist, the trigger condition node chain is executed, and the interaction object identifier is stored in the hash set of triggered interaction objects. If the interaction is triggered by dragging and dropping items, the dragged items are matched and verified based on the list of interactive objects. When the matching verification is met, the trigger condition node chain is executed. After the interaction is successful, it is determined whether to reduce the item's current durability. When the durability reaches zero, the item is automatically removed from the inventory.
[0041] S104. Based on 2D ray detection and shader highlighting technology, the cursor type is switched and outline highlighting is performed on interactive objects to generate a visual interactive cursor shape that can distinguish different interactive functions.
[0042] This step achieves intelligent linkage between cursor shape and interaction possibilities, as well as non-intrusive object highlighting. Existing technologies typically require adding extra components or creating sub-objects for each interactive object to achieve highlighting, while this application avoids increased memory overhead and scene complexity by dynamically modifying object material properties. Simultaneously, it links the cursor type attribute of interactive objects with the interaction distance range, synchronously switching the cursor texture and shader highlight stroke width within the interaction range, thus creating intuitive interaction prompts and effectively improving the user experience in the game.
[0043] Based on 2D ray detection and shader highlighting technology, the cursor type switching and outline highlighting of interactive objects are performed to generate a visual interactive cursor shape that can distinguish different interactive functions. The steps include: The scene and interactive objects pointed to by the mouse are detected using 2D ray detection technology, and branch processing is performed based on the determination results of the scene and interactive objects hit by the ray. When a ray hits an interactive object, if the mouse is within the interactive tooltip area or in sub-scene mode, the cursor type of the interactive object is switched to the specified cursor, and the interactive object is outlined and highlighted using Shader highlighting technology. If the ray misses the interactive object or the mouse moves out of the interactive tooltip area, the cursor type of the interactive object will be switched to the original cursor and the stroke highlight will be cleared.
[0044] For example, when the mouse hovers over a collectible "ancient key," within the cursor's tooltip area, the cursor changes from an arrow to a hand, and the key's edge is rendered with a glowing green outline by the shader. When the mouse moves away, the cursor returns to its original state, and the key's outline disappears. When the mouse hovers over a door that requires a key to open, the cursor changes to a lock or unlock icon, and a red outline appears around the door.
[0045] Example 2 The above is the interaction system between virtual characters and scenes in escape room games provided in the embodiments of this application. The following is the interaction system between virtual characters and scenes in escape room games provided in the embodiments of this application.
[0046] An interaction system for virtual characters and environments in escape room games, including: The two-layer configurable interaction architecture management module is used to construct a two-layer configurable interaction architecture consisting of a condition node chain and an action node chain. The condition node chain is used to define the multi-dimensional composite conditions on which the interaction between the virtual character and objects in the game scene depends, and the action node chain is used to execute an interactive action sequence containing Tween animations and asynchronous callbacks after the multi-dimensional composite conditions are met. The multimodal input adaptation module is used to acquire user operation command data, determine interactive objects based on a hierarchical distance determination strategy, or apply directional weights to candidate interactive objects according to the virtual character's orientation based on a direction-weighted nearest neighbor focus navigation algorithm, and select the object with the smallest weighted distance as the interactive object. The multi-mode interaction trigger management module is used to perform interaction verification based on the multi-mode fusion collision interaction trigger strategy and to control the cooldown time of interactive objects. When the interaction verification is met, the trigger condition node chain is executed. The multi-mode fusion collision interaction trigger strategy includes pure collision interaction trigger mode, collision and directional button combined interaction trigger mode, collision and condition combined interaction trigger mode, one-time interaction trigger mode, and drag-and-drop prop interaction trigger mode. The context-aware cursor module is used to switch cursor types and outline highlighting of interactive objects based on 2D ray detection and shader highlighting technology, generating visual interactive cursor shapes that can distinguish different interactive functions.
[0047] The two-tier configurable interaction architecture management module is used to construct a two-tier configurable interaction architecture consisting of a condition node chain and an action node chain. The condition node chain defines the multi-dimensional composite conditions upon which the interaction between the virtual character and objects in the game scene depends, while the action node chain executes a sequence of interactive actions, including Tween animations and asynchronous callbacks, after these multi-dimensional composite conditions are met. Configure at least one multi-dimensional composite condition in the condition node chain. The multi-dimensional composite condition includes item existence judgment and state value calculation judgment. Item existence judgment includes whether the target item exists or not. State value calculation judgment includes four types of comparison operations: equal to, not equal to, greater than, and less than. When the multi-dimensional composite condition judgment result is met, the action node chain is triggered to contain an interactive action sequence of Tween animation and asynchronous callback; the interactive action sequence includes actions to show or hide objects, position transformation, rotation transformation, picking up items, playing animation, camera switching, scene switching, and playing text. A camera dictionary is built based on the scene's unique identifier and the camera's position coordinates. The camera dictionary is used to store the current camera position before scene switching and to restore the camera position after scene rollback. When performing an interactive action that includes a Tween animation, the game input is locked, and the next interactive action is triggered in the Tween animation completion callback.
[0048] The multimodal input adaptation module is used to acquire user operation command data, determine interactive objects based on a hierarchical distance determination strategy, or determine interactive objects based on a direction-weighted nearest neighbor focus navigation algorithm, applying directional weights to candidate interactive objects according to the virtual character's orientation, and selecting the object with the smallest weighted distance as the interactive object, including: The system detects the joystick axis value or the press status of the gamepad function keys. If the absolute value of the joystick axis exceeds the dead zone, or if a press signal is detected on a gamepad function key, the current operation mode is switched to gamepad control mode. Otherwise, the system detects the press status of any keyboard key or the left / right mouse button. If a press signal is detected, the current operation mode is switched to keyboard and mouse control mode.
[0049] The multimodal input adaptation module is used to acquire user operation command data, determine interactive objects based on a hierarchical distance determination strategy, or select the object with the smallest weighted nearest neighbor focus navigation algorithm based on the orientation of the virtual character, applying directional weights to candidate interactive objects. The system determines whether to execute a double-click callback based on the number of mouse double-clicks, and uses 2D raycasting technology to detect the scene and interactive objects the mouse is pointing at. Branching is then performed based on the determination of the scene and interactive objects hit by the raycast. When the ray hits an interactive object, if the mouse click position is within the direct interaction range, clicking the interactive object will trigger the interaction verification. If the mouse click location is within the interaction prompt area and the interactive object has an interactive point, clicking the interactive object will trigger the virtual character to automatically navigate to the preset interactive point; If the mouse click location is outside the interactive prompt range, the virtual character will be triggered to move to the scene coordinates corresponding to the mouse click. If the current scene is in sub-scene mode, clicking on the interactive object will trigger the interaction verification. When the ray misses an interactive object, the virtual character is triggered to move to the scene coordinates corresponding to the mouse click.
[0050] The multimodal input adaptation module is used to acquire user operation command data, determine interactive objects based on a hierarchical distance determination strategy, or determine interactive objects based on a direction-weighted nearest neighbor focus navigation algorithm, applying directional weights to candidate interactive objects according to the virtual character's orientation, and selecting the object with the smallest weighted distance as the interactive object, including: Get all interactive objects in the scene, calculate the camera's view frustum plane, retain only the candidate interactive objects within the field of view, and sort them by World coordinates; When a directional key press signal is detected, the vector from the current focused interactive object to each candidate interactive object is calculated, as well as the dot product of the vector and the normalized directional vector is calculated. The candidate interactive objects whose dot product is not less than a preset dot product threshold are given a distance-weighted score, and the candidate interactive object with the smallest score is selected as the next interactive object.
[0051] The multi-mode interaction trigger management module is used to perform interaction verification based on a multi-mode fusion collision interaction trigger strategy and to control the cooldown time of interactive objects. When the interaction verification is met, the trigger condition node chain is executed. The multi-mode fusion collision interaction trigger strategy includes pure collision interaction trigger mode, collision and directional button combined interaction trigger mode, collision and condition combined interaction trigger mode, one-time interaction trigger mode, and drag-and-drop item interaction trigger mode. If it is a pure collision interaction trigger mode, then check whether the virtual character has entered the collision trigger area and meets the cooldown time condition. When the check is met, the trigger condition node chain is executed. If the interaction is triggered by a combination of collision and directional keys, then it checks whether the virtual character has entered the collision zone and meets the cooldown time condition, and whether the keyboard directional key press signal is detected. When the checks are met, the trigger condition node chain is executed. If it is a collision and condition-based interactive trigger mode, then check whether the virtual character has entered the collision trigger area and meets the cooldown time condition, and check whether other item / state conditions are met. When the checks are met, the trigger condition node chain is executed. If it is a one-time interaction trigger mode, the hash set of triggered interaction objects is retrieved. If the interaction object identifier does not exist, the trigger condition node chain is executed, and the interaction object identifier is stored in the hash set of triggered interaction objects. If the interaction is triggered by dragging and dropping items, the dragged items are matched and verified based on the list of interactive objects. When the matching verification is met, the trigger condition node chain is executed. After the interaction is successful, it is determined whether to reduce the item's current durability. When the durability reaches zero, the item is automatically removed from the inventory.
[0052] The context-aware cursor module is used to switch cursor types and add outlines to interactive objects based on 2D ray detection and shader highlighting techniques, generating visual interactive cursor forms that can distinguish different interactive functions, including: The scene and interactive objects pointed to by the mouse are detected using 2D ray detection technology, and branch processing is performed based on the determination results of the scene and interactive objects hit by the ray. When a ray hits an interactive object, if the mouse is within the interactive tooltip area or in sub-scene mode, the cursor type of the interactive object is switched to the specified cursor, and the interactive object is outlined and highlighted using Shader highlighting technology. If the ray misses the interactive object or the mouse moves out of the interactive tooltip area, the cursor type of the interactive object will be switched to the original cursor and the stroke highlight will be cleared.
[0053] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the system and modules described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0054] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for interaction between virtual characters and scenes in escape room games, characterized in that, Includes the following steps: S101. Construct a two-layer configurable interaction architecture consisting of a condition node chain and an action node chain; wherein, the condition node chain is used to define the multi-dimensional composite conditions on which the interaction between the virtual character and objects in the game scene depends, and the action node chain is used to execute an interactive action sequence containing Tween animation and asynchronous callback after the multi-dimensional composite conditions are met. S102. Obtain user operation command data, determine interactive objects based on hierarchical distance determination strategy, or based on direction weighted nearest neighbor focus navigation algorithm, apply directional weights to candidate interactive objects according to the virtual character's orientation, and select the object with the smallest weighted distance as the interactive object. S103. Perform interaction verification based on the multi-mode fusion collision interaction triggering strategy, and implement cooldown time control for the interactive object. When the interaction verification is met, the trigger condition node chain is executed. The multi-mode fusion collision interaction triggering strategy includes pure collision interaction triggering mode, collision and directional button combined interaction triggering mode, collision and condition combined interaction triggering mode, one-time interaction triggering mode, and drag-and-drop prop interaction triggering mode. S104. Based on 2D ray detection and shader highlighting technology, the cursor type of the interactive object is switched and outlined for highlighting, generating a visual interactive cursor shape that can distinguish different interactive functions.
2. The method for interaction between virtual characters and scenes in escape room games according to claim 1, characterized in that, Step S101 includes the following steps: At least one multi-dimensional composite condition is configured in the condition node chain. The multi-dimensional composite condition includes an item existence judgment and a state value calculation judgment. The item existence judgment includes whether the target item exists or not. The state value calculation judgment includes four types of comparison operations: equal to, not equal to, greater than, and less than. When the multidimensional composite condition judgment result is satisfied, the action node chain is triggered to contain an interactive action sequence of Tween animation and asynchronous callback; the interactive action sequence includes actions to show or hide objects, position transformation, rotation transformation, picking up items, playing animation, camera switching, scene switching, and playing text. A camera dictionary is constructed based on the scene's unique identifier and the camera's position coordinates. The camera dictionary is used to store the current camera position before scene switching and to restore the camera position after scene rollback. When performing an interactive action that includes a Tween animation, the game input is locked, and the next interactive action is triggered in the Tween animation completion callback.
3. The method for interaction between virtual characters and scenes in escape room games according to claim 1, characterized in that, In step S102, obtaining user operation instruction data includes the following steps: The system detects the joystick axis value or the press status of the gamepad function keys. If the absolute value of the joystick axis exceeds the dead zone, or if a press signal is detected on a gamepad function key, the current operation mode is switched to gamepad control mode. Otherwise, the system detects the press status of any keyboard key or the left / right mouse button. If a press signal is detected, the current operation mode is switched to keyboard and mouse control mode.
4. The method for interaction between virtual characters and scenes in escape room games according to claim 1, characterized in that, In step S102, determining the interactive object based on the layered distance determination strategy includes the following steps: The system determines whether to execute a double-click callback based on the number of mouse double-clicks, and uses 2D raycasting technology to detect the scene and interactive objects the mouse is pointing at. Branching is then performed based on the determination of the scene and interactive objects hit by the raycast. When the ray hits the interactive object, if the mouse click position is within the direct interaction range, clicking the interactive object will trigger the interaction verification. If the mouse click location is within the interactive prompt range and the interactive object has interactive points, clicking the interactive object will trigger the virtual character to automatically navigate to the preset interactive point; If the mouse click location is outside the interactive prompt range, the virtual character will be triggered to move to the scene coordinates corresponding to the mouse click. If the current scene mode is sub-scene mode, clicking the interactive object will trigger interactive verification; When the ray does not hit the interactive object, the virtual character is triggered to move to the scene coordinates corresponding to the mouse click.
5. The method for interaction between virtual characters and scenes in escape room games according to claim 1, characterized in that, In step S102, the method of selecting the object with the smallest weighted distance as the interactive object based on the direction-weighted nearest neighbor focus navigation algorithm includes the following steps: Get all interactive objects in the scene, calculate the camera's view frustum plane, retain only the candidate interactive objects within the field of view, and sort them by World coordinates; When a directional key press signal is detected, the vector from the currently focused interactive object to each candidate interactive object is calculated, and the dot product of the vector and the normalized directional vector is calculated. Candidate interactive objects whose dot product is not less than a preset dot product threshold are then scored using a distance-weighted method, and the candidate interactive object with the lowest score is selected as the next interactive object. score = distance / (dot + 0.1) Where score is the rating of the candidate interactive object, distance is the distance between the currently focused interactive object and the candidate interactive object, and dot is the normalized vector dot product.
6. The method for interaction between virtual characters and scenes in escape room games according to claim 1, characterized in that, Step S103 includes the following steps: If it is a pure collision interaction trigger mode, then check whether the virtual character has entered the collision trigger area and meets the cooldown time condition. When the check is met, the condition node chain is triggered to execute. If the interaction is triggered by a combination of collision and directional keys, then it is checked whether the virtual character has entered the collision trigger area and meets the cooldown time condition, and whether the keyboard directional key press signal is detected. When the checks are met, the condition node chain is triggered to execute. If it is a collision and condition-based interactive triggering mode, then check whether the virtual character has entered the collision triggering area and meets the cooldown time condition, and check whether other item / state conditions are met. When the checks are met, the condition node chain is triggered to execute. If it is a one-time interaction trigger mode, the hash set of triggered interaction objects is retrieved. If the interaction object identifier does not exist, the condition node chain is triggered to execute, and the interaction object identifier is stored in the hash set of triggered interaction objects. If the interaction is triggered by dragging and dropping items, the dragged items are matched and verified based on the list of interactive objects. When the matching and verification is satisfied, the trigger condition node chain is executed. After the interaction is successful, it is determined whether to reduce the item's current durability. When the durability reaches zero, the item is automatically removed from the inventory.
7. The method for interaction between virtual characters and scenes in escape room games according to claim 1, characterized in that, Step S104 includes the following steps: The scene and interactive objects pointed to by the mouse are detected using 2D ray detection technology, and branch processing is performed based on the determination results of the scene and interactive objects hit by the ray. When the ray hits the interactive object, if the mouse is within the interactive prompt area or in sub-scene mode, the cursor type of the interactive object is switched to the specified cursor, and the interactive object is outlined and highlighted using Shader highlighting technology. If the ray does not hit the interactive object or the mouse moves out of the interactive tooltip area, the cursor type of the interactive object will be switched to the original cursor and the stroke highlight will be cleared.
8. A system for interaction between virtual characters and scenes in escape room games, used to implement the method for interaction between virtual characters and scenes in escape room games as described in any one of claims 1-7, characterized in that, include: A two-layer configurable interaction architecture management module is used to construct a two-layer configurable interaction architecture consisting of a condition node chain and an action node chain. The condition node chain is used to define the multi-dimensional composite conditions on which the interaction between the virtual character and objects in the game scene depends, and the action node chain is used to execute an interactive action sequence containing Tween animation and asynchronous callback after the multi-dimensional composite conditions are met. The multimodal input adaptation module is used to acquire user operation command data, determine interactive objects based on a hierarchical distance determination strategy, or apply directional weights to candidate interactive objects according to the virtual character's orientation based on a direction-weighted nearest neighbor focus navigation algorithm, and select the object with the smallest weighted distance as the interactive object. The multi-mode interaction trigger management module is used to perform interaction verification based on the multi-mode fusion collision interaction trigger strategy and to control the cooldown time of the interactive object. When the interaction verification is met, the trigger condition node chain is executed. The multi-mode fusion collision interaction trigger strategy includes pure collision interaction trigger mode, collision and directional button combined interaction trigger mode, collision and condition combined interaction trigger mode, one-time interaction trigger mode, and drag-and-drop prop interaction trigger mode. The context-aware cursor module is used to switch cursor types and outline highlighting of interactive objects based on 2D ray detection and shader highlighting technology, generating visual interactive cursor shapes that can distinguish different interactive functions.
9. The interaction system between virtual characters and scenes in escape room games according to claim 8, characterized in that, The two-layer configurable interaction architecture management module is used to construct a two-layer configurable interaction architecture composed of a condition node chain and an action node chain. The condition node chain defines the multi-dimensional composite conditions upon which the interaction between the virtual character and objects in the game scene depends, and the action node chain executes an interaction action sequence including Tween animations and asynchronous callbacks after the multi-dimensional composite conditions are met. At least one multi-dimensional composite condition is configured in the condition node chain. The multi-dimensional composite condition includes an item existence judgment and a state value calculation judgment. The item existence judgment includes whether the target item exists or not. The state value calculation judgment includes four types of comparison operations: equal to, not equal to, greater than, and less than. When the multidimensional composite condition judgment result is satisfied, the action node chain is triggered to contain an interactive action sequence of Tween animation and asynchronous callback; the interactive action sequence includes actions to show or hide objects, position transformation, rotation transformation, picking up items, playing animation, camera switching, scene switching, and playing text. A camera dictionary is constructed based on the scene's unique identifier and the camera's position coordinates. The camera dictionary is used to store the current camera position before scene switching and to restore the camera position after scene rollback. When performing an interactive action that includes a Tween animation, the game input is locked, and the next interactive action is triggered in the Tween animation completion callback.
10. The interaction system between virtual characters and scenes in escape room games according to claim 8, characterized in that, In the multimodal input adaptation module, acquiring user operation command data includes: The system detects the joystick axis value or the press status of the gamepad function keys. If the absolute value of the joystick axis exceeds the dead zone, or if a press signal is detected on a gamepad function key, the current operation mode is switched to gamepad control mode. Otherwise, the system detects the press status of any keyboard key or the left / right mouse button. If a press signal is detected, the current operation mode is switched to keyboard and mouse control mode.