Game character movement limiting method and device, equipment and storage medium
By hierarchically marking and real-time detection of user interface elements in the virtual environment, dynamically adjusting the movement control logic of game characters, solving the accuracy of game characters' movement control in complex user interface environments, and improving the accuracy and fluency of game interactions.
Patent Information
- Application Number
- CN202510164326.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-03-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing game development methods have difficulty accurately controlling the movement of game characters in complex, dynamic user interface environments, causing characters to accidentally cross UI elements, continue to move without moving, or are erroneously restricted in areas that can be moved.
By hierarchical marking of user interface elements in the virtual environment, a set of user interface elements with preset hierarchical markings is obtained; based on the set of user interface elements, real-time detection and analysis of the position information of the input device to obtain the position relationship information of the input device and the user interface elements; based on the position relationship information, dynamic adjustment of the movement control logic of the game characters is realized to achieve the movement restrictions of the game characters.
It realizes accurate response to complex and dynamic user interface environments, accurately recognizes and limits the movement of game characters, and improves the accuracy and fluency of game interactions.
Smart Images

Figure CN119620896A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of game technology, and in particular to a method, device, equipment and storage medium for limiting the movement of game characters. Background Art
[0002] In modern game development, the user interface (UI) and the interaction with game characters are a key design element. Traditional game development methods usually use fixed UI layouts and simple collision detection mechanisms to manage the movement of game characters. This approach works well in basic scenes and prevents characters from passing through UI elements or moving at inappropriate times.
[0003] However, as the complexity of games increases, especially in massively multiplayer online games (MMOGs) or complex role-playing games (RPGs), user interfaces become more and more dynamic and complex. These games often contain multi-level menus, floating windows, draggable UI elements, etc. In such complex environments, traditional fixed layouts and simple collision detection methods show obvious limitations.
[0004] The main drawback is that these traditional methods lack the ability to respond to dynamically changing UI elements in real time. When players interact with complex UIs, such as opening multiple overlapping windows or dragging UI elements, the game system often cannot accurately determine which areas should restrict the character's movement. This leads to problems such as characters accidentally crossing UI elements, continuing to move when they should not, or being incorrectly restricted in areas where they can move. These problems not only affect the playability of the game, but also reduce the player's immersion and overall gaming experience. Summary of the invention
[0005] The main purpose of the present invention is to solve the technical problem that existing games lack the ability to accurately control the movement of game characters in a complex and dynamic user interface environment; A first aspect of the present invention provides a method for limiting the movement of a game character, the method comprising: Performing hierarchical marking processing on the user interface elements in the virtual environment to obtain a set of user interface elements with preset hierarchical markings; According to the user interface element set, real-time detection and analysis are performed on the position information of the input device to obtain position relationship information between the input device and the user interface element; Based on the position relationship information, the movement control logic of the game character in the virtual environment is dynamically adjusted to achieve movement restriction of the game character.
[0006] Optionally, in a first implementation of the first aspect of the present invention, the step of performing hierarchical marking processing on the user interface elements in the virtual environment to obtain a set of user interface elements with preset hierarchical markings includes: Traverse and process each user interface element in the virtual environment to obtain a list of user interface elements; According to a predefined hierarchical rule, each user interface element in the user interface element list is assigned a preset hierarchical mark or a logical group to obtain a user interface element with a hierarchical mark; The user interface elements with the hierarchical marks are classified and sorted to obtain a set of user interface elements with preset hierarchical marks.
[0007] Optionally, in a second implementation of the first aspect of the present invention, assigning a preset hierarchical mark or logical group to each user interface element in the user interface element list according to a predefined hierarchical rule, and obtaining the user interface element with the hierarchical mark includes: Traversing the user interface element list to obtain the current user interface element to be processed; According to the attribute information of the user interface element to be processed, matching and analyzing the predefined hierarchical rules are performed to obtain the corresponding hierarchical mark type; Based on the applicable level mark type, a mark assignment process is performed on the current user interface element to be processed to obtain a user interface element with a corresponding level mark.
[0008] Optionally, in a third implementation of the first aspect of the present invention, the performing real-time detection and analysis on the position information of the input device according to the set of user interface elements to obtain the position relationship information between the input device and the user interface element includes: Perform real-time monitoring and processing on the position of the input device on the screen to obtain real-time position data of the input device; According to the real-time position data of the input device, the user interface element is detected by using the event system and the graphic ray detector to obtain the interaction state between the input device and the user interface element; Based on the interaction state, the positional relationship between the input device and the user interface element with a specific level mark is determined and processed to obtain positional relationship information between the input device and the user interface element.
[0009] Optionally, in a fourth implementation of the first aspect of the present invention, detecting the user interface element using an event system and a graphic ray detector according to the real-time position data of the input device to obtain the interaction state between the input device and the user interface element includes: Based on the real-time position data of the input device, the virtual camera is subjected to perspective conversion processing to obtain the starting point and direction of the ray in the world space; Using the starting point and direction of the ray, initializing and configuring the graphic ray detector to obtain a configured ray detector; Using the configured ray detector, perform ray projection processing on the user interface elements in the virtual environment to obtain intersection information between the ray and the user interface elements; According to the intersection information, the event system is triggered and analyzed to obtain the interaction status between the input device and the user interface element.
[0010] Optionally, in a fifth implementation of the first aspect of the present invention, dynamically adjusting the movement control logic of the game character in the virtual environment based on the position relationship information to implement movement restriction of the game character includes: According to the position relationship information, a state update process is performed on the mobile controller of the game character to obtain the current mobile state of the game character; Based on the current movement state, the game character's movement input is subjected to validity judgment processing to obtain a validity result of the movement input; According to the validity result, adjusting the movement behavior of the game character to obtain an adjusted movement control signal; Based on the adjusted movement control signal, the movement restriction of the game character is executed and processed to obtain the movement restriction output of the game character.
[0011] Optionally, in a sixth implementation of the first aspect of the present invention, adjusting the movement behavior of the game character according to the validity result to obtain the adjusted movement control signal includes: Performing threshold comparison processing on the effectiveness result to obtain an adjustment strategy for the movement behavior; According to the adjustment strategy, the movement parameters of the game character are corrected and calculated to obtain a corrected movement parameter set; Based on the modified movement parameter set, the kinematic model of the game character is updated to obtain an updated movement state; According to the updated motion state, the movement controller of the game character is processed by command generation to obtain an adjusted movement control signal.
[0012] A second aspect of the present invention provides a device for limiting the movement of a game character, the device comprising: A marking module, used to perform hierarchical marking processing on the user interface elements in the virtual environment to obtain a set of user interface elements with preset hierarchical markings; A detection module, used to perform real-time detection and analysis on the position information of the input device according to the set of user interface elements, and obtain position relationship information between the input device and the user interface elements; The control module is used to dynamically adjust the movement control logic of the game character in the virtual environment based on the position relationship information to achieve movement restriction of the game character.
[0013] The third aspect of the present invention provides a device for restricting the movement of a game character, comprising: a memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected via lines; the at least one processor calls the instructions in the memory so that the game character movement restriction device executes the steps of the above-mentioned game character movement restriction method.
[0014] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the steps of the above-mentioned method for limiting the movement of a game character.
[0015] The above-mentioned method, device, equipment and storage medium for limiting the movement of game characters perform hierarchical marking processing on the user interface elements in the virtual environment to obtain a set of user interface elements with preset hierarchical markings; based on the set of user interface elements, the position information of the input device is detected and analyzed in real time to obtain the position relationship information between the input device and the user interface element; based on the position relationship information, the movement control logic of the game character in the virtual environment is dynamically adjusted to achieve the movement restriction of the game character. This method accurately identifies complex and changing UI environments through dynamic marking and real-time detection of UI elements, and adjusts the movement control logic of the game character accordingly. This method solves the problem that traditional fixed layouts and simple collision detection cannot accurately control the movement of game characters in complex UI environments, and improves the accuracy and fluency of game interactions.
[0016] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0017] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 This is a schematic diagram of a first embodiment of a method for limiting movement of a game character in an embodiment of the present invention; Figure 2 A schematic diagram of an embodiment of a device for limiting the movement of a game character in an embodiment of the present invention; Figure 3 Schematic diagram of an embodiment of a device for limiting the movement of a game character in an embodiment of the present invention. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0020] The terms "including" and "having" and any variations thereof mentioned in the embodiments of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device end including a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or device ends.
[0021] To facilitate understanding of this embodiment, a method for limiting the movement of a game character disclosed in an embodiment of the present invention is first described in detail. Figure 1 As shown, the method comprises the following steps: 101. Performing hierarchical marking processing on user interface elements in the virtual environment to obtain a set of user interface elements with preset hierarchical markings; In one embodiment of the present invention, the hierarchical labeling processing of the user interface elements in the virtual environment to obtain a set of user interface elements with preset hierarchical labels includes: traversing each user interface element in the virtual environment to obtain a list of user interface elements; assigning a preset hierarchical label or logical group to each user interface element in the user interface element list according to predefined hierarchical rules to obtain user interface elements with hierarchical labels; and classifying and organizing the user interface elements with hierarchical labels to obtain a set of user interface elements with preset hierarchical labels.
[0022] Specifically, the process of traversing each user interface element in the virtual environment to obtain a list of user interface elements is usually implemented by retrieving all objects in the scene hierarchy in the Unity engine and determining whether they have UI components or are mounted under the Canvas. When executed, the script starts from the top-level Canvas in the Hierarchy panel, recursively accesses all child objects of the Canvas, detects each object one by one whether it contains common UI components such as GraphicRaycaster, Image, Text, and then identifies the objects that meet the UI conditions as user interface elements. When performing this traversal operation, the script obtains all child object references based on the Transform hierarchical relationship of the object with the help of loops and judgment statements written in C#, and records the object name, instance ID and related component information that meet the UI judgment conditions into a list of user interface elements. In the script, data structures such as List or Dictionary are often used to uniformly store this information to facilitate subsequent query and management of the same data source. This process aims to completely collect all UI elements in the scene and ensure that each UI object is accurately identified and extracted into the same list.
[0023] Specifically, according to the predefined hierarchical rules, each user interface element in the user interface element list is assigned a preset hierarchical mark or logical group, and the implementation method of obtaining the user interface element with the hierarchical mark relies on a set of judgment logics pre-written in the script to identify the hierarchical category or logical relationship to which the UI element belongs. The script first reads the component currently mounted by the user interface element, the name of the Canvas where it is located, the tag or layer and other attribute information, and then compares it with the hierarchical rules built into the script. Hierarchical rules are often stored in the form of enumeration or configuration files, for example, setting objects containing the keyword "UI_Hierarchy" in the name as interactive hierarchies, or treating objects with the layer number "13" as UI types that require special processing. After the matching is completed, the script uses the corresponding numerical value, enumeration constant or mark character to assign the user interface element so that it has the hierarchical mark or logical group attribute of "UI_Hierarchy". In this way, each user interface element will be attributed to a clear hierarchical category in the script, thereby realizing the group management of different UI elements. The assignment logic is usually completed in C# through simple property assignment or writing to a custom script field in the Inspector. After the mark assignment is completed, the script writes the user interface element back to the memory or list structure.
[0024] Specifically, the implementation process of classifying and sorting the user interface elements with hierarchical tags to obtain a set of user interface elements with preset hierarchical tags is to traverse the list of user interface elements that have been marked in the previous step through the script, and put them into the corresponding collection or dictionary according to the hierarchical tags or logical group information recorded on the elements. The script will first read each object in the list, check whether its tag value is "UI_Hierarchy", "UI_Interactive" or other defined classification identifiers, and then add the object to the corresponding container (such as Dictionary) according to the identifier content. <string, List <gameobject>>) or a different List <t>When the script is executed, it often creates several new collection structures in memory, establishes a separate key-value pair or a separate list for each hierarchical tag, and then inserts the object data item by item. This step will not make additional modifications to the object itself, but will centrally manage objects with the same tag attributes to facilitate faster filtering and access when specific types of UI elements need to be processed. After the classification and sorting is completed, one or more user interface element collections with preset hierarchical tags will be generated, so that the downstream interaction detection and movement restriction logic can quickly distinguish UI elements of different levels, reduce repeated retrieval of irrelevant objects, and achieve efficient classification and positioning of UI elements at the data level.
[0025] Furthermore, according to the predefined hierarchical rules, each user interface element in the user interface element list is assigned a preset hierarchical tag or logical group to obtain the user interface element with the hierarchical tag, which includes: traversing the user interface element list to obtain the user interface element currently to be processed; matching and analyzing the predefined hierarchical rules according to the attribute information of the user interface element currently to be processed to obtain the corresponding hierarchical tag type; based on the applicable hierarchical tag type, tag assignment processing is performed on the user interface element currently to be processed to obtain the user interface element with the corresponding hierarchical tag.
[0026] Specifically, when traversing the list of user interface elements to obtain the current user interface element to be processed, the script usually performs a loop access operation in the Unity engine using the C# programming language, and retrieves the specific information of the user interface elements one by one by referencing the saved list. The script will obtain the unique identifier, name, and Canvas level of the element in the list structure, and then use a for loop or a foreach loop to read the attribute data of each element one by one. At the implementation level, the code will initialize the loop variable at the beginning of the list, and then continuously increment the index when the loop condition is met. During this period, the same reading and judgment logic is executed on each user interface element in order to find all information related to subsequent rule matching. The script queries the GameObject or UI component of each user interface element, and GetComponent is often used to read related information. <t>Or directly access its name, tag, layer and other fields. During the traversal process, if the list is large, we will consider introducing certain optimization methods, such as limiting the update frequency or filtering in advance in the editor mode, so as to avoid unnecessary performance consumption at runtime. After the traversal is completed, the script will temporarily store the user interface element currently read in a temporary variable to form a reference to the current user interface element to be processed, and further judge or mark the element within this loop. This traversal method can ensure that all UI objects are fully scanned, and ensure that new user interface elements can be added to the list normally when they appear, avoiding missing specific UI nodes or repeatedly processing the same object. The traversal processing here relies on the sequential reading of the data set in the memory, and realizes orderly access one by one through the movement of the subscript index or the iterator pointer. After the traversal is completed, the last located user interface element can be passed to the subsequent rule matching link, so that the script can accurately identify and distinguish all different types of UI objects in the list.
[0027] Specifically, according to the attribute information of the current user interface element to be processed, the predefined hierarchical rules are matched and analyzed to obtain the corresponding hierarchical mark type. It is necessary to define a series of judgment conditions or rule sets in advance in the script to confirm the classification to which different UI objects should belong. In the Unity scene, several common rules can be set centrally through the script. For example, when the tag of the object is "OverlayUI", it is determined that it belongs to the top display layer, or when the object is mounted with the Interactable script component, it is determined that it belongs to the interactive layer. When the script is running, the information of the current user interface element to be processed will be compared with these rule conditions one by one to determine which hierarchical mark type the element meets. The implementation method usually uses if-else or switch-case structures in C# code. The attribute information of the object includes name, label, layer, component type, and rendering mode of its parent Canvas, etc. These attributes can provide multiple dimensions for judgment. The hierarchical rule can be designed as an enumeration or a set of constants. After the comparison is successful, the script will output the corresponding enumeration value or constant identifier as the matching result. If an element name contains specific characters or the Canvas to which it belongs sets a certain rendering order, the script will map the element to the corresponding tag type to find out the role it plays in the overall UI system. The matching analysis and processing phase is often implemented through a series of conditional filtering, such as detecting whether the elements meet key fields such as "UI_Hierarchy" one by one, and returning the hierarchical tag corresponding to the field when the detection passes. When the script matches different rules, it is necessary to ensure that only the most suitable classification tag is selected for each user interface element to avoid repeated assignment of the same object or conflicting identification. After the determination is completed, the code will temporarily store the matching result and wait for the tag assignment step to write the result to the object's properties. In this way, each user interface element can be accurately assigned to a reasonable hierarchical tag type.
[0028] Specifically, based on the applicable hierarchical tag type, the current user interface element to be processed is marked and assigned. When a user interface element with a corresponding hierarchical tag is obtained, the script usually writes the tag type just matched into the field, hierarchy or Tag of the object, and may also store a mapping relationship in the internal data structure maintained by the script. In the Unity engine environment, if the layer or tag of the object needs to be modified, the script will call the property interface of the object itself, such as gameObject.layer = 13 or gameObject.tag = "UI_Interactive", so that the element can be actually divided into a specific group, and then all elements of the same tag type can be quickly filtered out with the help of Unity's built-in method. Another way is to mount a custom component on the object, save the hierarchical tag type through the field of the component, and then retrieve this component to confirm the classification of the element during detection or rendering. After the tag assignment process is completed, the script will write the marked user interface elements back to the original list or put them into a container that specifically manages marked elements to avoid repeated calculations during subsequent retrieval. The implementation process is common in functions in C#, where the hierarchical marker type is injected into the object by directly modifying the properties of the current object to be processed or calling a method on the object reference, and then using assignment operations or method parameter passing.
[0029] 102. Perform real-time detection and analysis on the position information of the input device according to the set of user interface elements to obtain position relationship information between the input device and the user interface elements; In one embodiment of the present invention, the real-time detection and analysis of the position information of the input device based on the set of user interface elements to obtain the position relationship information of the input device and the user interface elements includes: real-time monitoring and processing of the position of the input device on the screen to obtain real-time position data of the input device; based on the real-time position data of the input device, detecting the user interface elements using an event system and a graphic ray detector to obtain an interaction state between the input device and the user interface elements; based on the interaction state, determining and processing the position relationship between the input device and the user interface elements with specific hierarchical marks to obtain the position relationship information between the input device and the user interface elements.
[0030] Specifically, when the position of the input device on the screen is monitored and processed in real time and the real-time position data of the input device is obtained, the script in the Unity engine usually calls the API related to the input system to obtain the position of the mouse or touch point in the screen coordinate system, and continues to perform this acquisition action in each Update cycle or custom refresh cycle. At the code level, properties such as Input.mousePosition or Touch coordinates are often used to read the pixel position of the current cursor or touch point relative to the lower left corner of the screen. After reading these position data, the script will save them in a variable or structure used to track the position of the input device for subsequent analysis and processing. At this time, the normalized coordinate value can be calculated or converted in combination with the screen resolution or CanvasScaler settings to maintain consistent input detection effects in multi-resolution scenes. This real-time position data plays an important role in the scene logic because it can reflect the dynamic movement trajectory of the input device in the interface at any time. In order to ensure the update frequency and accuracy, the script usually chooses to collect position data in each frame or fixed time interval, and uses Time.deltaTime or timer functions to achieve a stable sampling frequency. In the case of multi-finger touch, the touch array will be traversed to obtain the screen coordinates of different touch points in turn, so as to ensure that all touch points are tracked and recorded in a timely manner. The real-time position data obtained in this way can be kept highly synchronized with the user's operation, allowing the system to be more accurate in judging the relationship between the mouse or finger and the interface elements. The monitoring processing here does not rely on external hardware delay settings, but uses Unity's own input acquisition mechanism, thereby avoiding compatibility barriers when porting across platforms or connecting to diverse devices, and enabling the position data to match the engine rendering progress at any time.
[0031] Specifically, according to the real-time position data of the input device, the event system and the graphic ray detector are used to detect the user interface elements. When the interaction state between the input device and the user interface elements is obtained, the script will enable the EventSystem component in the Unity scene and add a GraphicRaycaster to the Canvas or a specific UI object. The event system is responsible for tracking the interaction between the mouse pointer or touch point and the UI object at runtime, and the GraphicRaycaster can convert the screen coordinates into a ray emitted from the camera perspective, and detect whether the ray coincides with the UI graphic element in turn. After obtaining the screen position of the input device, the script will use PointerEventData or a custom Raycast entry function, use the screen coordinates as the starting point of the ray, combine the camera perspective or Canvas configuration to generate a ray that can be used for UI collision detection, and then call the GraphicRaycaster.Raycast method to obtain information about all hit UI objects. This process usually returns a list containing RaycastResult, each of which contains the detected UI element reference, collision depth, and other content. The script will determine which UI element the cursor or touch point is currently hovering over or clicking based on the result entry of the ray collision, and update this state to the structure of the input event data. The types of interaction states may include PointerEnter, PointerExit, PointerClick, etc., depending on the EventSystem's recognition of the input action. At this stage, if multiple UI elements overlap at the same coordinates, the script will determine the first object to be detected according to the rendering order of its Canvas or the layer depth. In this way, the system can accurately identify the UI element that the user is currently pointing to or operating, and provide detailed interaction information for subsequent logic. The implementation of this detection process mainly relies on the cooperation between Unity's built-in event system and the ray detector, and does not require additional third-party plug-ins or hardware support.
[0032] Specifically, based on the interaction state, the positional relationship between the input device and the user interface element with a specific hierarchical mark is determined and processed. When the positional relationship information between the input device and the user interface element is obtained, the script reads the UI element reference obtained from the RaycastResult list or event system feedback in the previous step, and combines the hierarchical mark previously assigned to each UI element to identify the specific interaction range where the current input device is located. When the script determines the hierarchical mark or logical group information of these UI elements, it usually compares multiple result items in the list one by one to confirm that the input device is indeed on an object with a target hierarchical mark, such as "UI_Interactive" or "UI_Hierarchy". Once it is confirmed that the interaction state matches the mark category, a description structure of the positional relationship information will be generated in the system to record which specific hierarchical UI object the input device has interacted or overlapped with at this moment. This allows subsequent functions to query the relationship information to determine whether the current cursor is located on the interactive UI, and whether the character movement should be blocked or other logic should be executed. A common approach to this determination is to define a method in a C# script that receives a list of RaycastResults, iterates through all its members, generates identifiers or Boolean values for UI objects with preset hierarchical tags, and then writes the results to global or local state variables. This operation only requires a brief comparison of the tag fields attached to each UI element, and then returns the determination result in the form of structured data so that other modules can read it quickly. After obtaining the positional relationship information between the input device and the user interface element, the system can use this information in character movement control, interface click events, or other logical levels to accurately distinguish and manage the interaction situation.
[0033] Furthermore, the method of detecting the user interface elements using the event system and the graphic ray detector according to the real-time position data of the input device to obtain the interaction status between the input device and the user interface elements includes: performing perspective conversion processing on the virtual camera based on the real-time position data of the input device to obtain the starting point and direction of the ray in the world space; performing initialization configuration processing on the graphic ray detector using the ray starting point and direction to obtain a configured ray detector; using the configured ray detector to perform ray projection processing on the user interface elements in the virtual environment to obtain intersection information between the ray and the user interface element; and triggering analysis processing on the event system based on the intersection information to obtain the interaction status between the input device and the user interface element.
[0034] Specifically, based on the real-time position data of the input device, the virtual camera is processed for perspective conversion. When the starting point and direction of the ray in the world space are obtained, the script in the Unity environment usually reads the mouse or touch position in the screen coordinate system first, and then generates a ray from the camera to the scene with the help of the ScreenPointToRay method of the Camera object. When executing this process, the code continuously collects the coordinate values from the Input.mousePosition or Touch object during the Update or custom refresh cycle, and uniformly processes them according to the screen resolution and Canvas settings. The script converts the current screen coordinates into the three-dimensional world space through the projection matrix calculation maintained internally by the Camera component, and then builds a Ray structure internally, which contains two fields: the starting point and the direction. The starting point is usually located at the near clipping plane or a later position facing the camera, and the direction is determined by the angle between the input coordinates and the positive direction of the camera. This perspective conversion process relies on the mathematical calculation of the underlying engine for the graphics rendering pipeline, and there is no need to manually write cumbersome projection algorithms in the script. The script saves the obtained rays in local or global variables for subsequent configuration of the graphics ray detector. At this point, the virtual camera in the system is responsible for managing the correspondence between the projection matrix and the world coordinate system, and the script obtains accurate viewing information by accessing Camera.main or other specified camera components. The rays generated in this way can be used to accurately detect user interface elements in subsequent stages, and in multi-camera or multi-screen scenes, the corresponding Camera object can be selected according to actual conditions to meet the ray conversion requirements under different resolutions or different interface layouts.
[0035] Specifically, the graphic ray detector is initialized and configured using the starting point and direction of the ray. When the configured ray detector is obtained, the script will search or instantiate the GraphicRaycaster component in the Unity scene, and set its detection range, sorting mode and other properties according to the various parameters of the current ray. This component is usually attached to the object where the Canvas or EventSystem is located. The initialization process includes setting common fields such as blocksRaycasts and ignoreReversedGraphics to control the interactive detection behavior between the ray and the UI graphic elements. A common practice in the script is to reset the parameters of the GraphicRaycaster before detection to ensure that the ray can successfully identify all target UI elements without being blocked by the rendering order or the interactive disabled state. The initialization configuration here involves the reference operation of the Raycast starting point and direction, and the Ray obtained in the previous step is used as the input source of the subsequent detection logic. The script stores the ray information internally through PointerEventData or a custom structure, and uses this information to determine the detection target of the screen coordinates or three-dimensional coordinates when the raycast method is called. In this process, it is necessary to properly assign values or call functions to the ray detector's event camera, event screen position, graphic Raycast sorting order, etc. to avoid omissions or multiple duplications in the detection results. At the same time, the script may add additional filtering conditions to the detector based on scene requirements, such as only detecting UI objects with certain hierarchical tags, thereby reducing misjudgment of irrelevant objects. The ray detector configured in this way will play a role in subsequent projection operations, allowing the system to accurately determine the occlusion relationship and interaction status of UI objects based on the same ray, and provide the event system with the required data support and hit information.
[0036] Specifically, when the ray detector with the above configuration is used to perform ray casting on the user interface elements in the virtual environment and obtain the intersection information between the ray and the user interface element, the script will call the GraphicRaycaster.Raycast method in each detection loop and pass in the PointerEventData or other custom structure that encapsulates the ray data, so that the detector can determine one by one which UI element the screen coordinates are projected onto. This calling process will internally traverse the renderable UI objects in the Canvas, and then calculate the intersection of the ray and the graphic boundary according to the RectTransform and graphic components of each object. The detector generates a corresponding RaycastResult entry for each intersection, which contains information such as the reference of the hit object, the ray depth, the UI rendering level, and stores all matching results in a list in one call. The script will then traverse or sort the list to determine which UI element is the first hit object, and use the corresponding RaycastResult as the current main hit target. If other hit objects also exist in the list, they will be arranged from high to low according to the rendering order or interaction priority. After the ray casting is completed, the script can obtain the RectTransform and specific intersection position of each hit UI element, thereby determining the correspondence between the user input in the screen coordinates and the UI rectangle. The intersection information generated in this way can not only identify whether the user has triggered interactive controls such as buttons and sliders, but also distinguish which object is at the top level and should receive events when multi-level interfaces overlap. This ray casting mechanism mainly relies on the UI graphics picking algorithm encapsulated in Unity and the visible range of the Canvas rendering component, which greatly reduces the burden of the script on the detection logic and can still quickly find the target UI in a complex interface layout.
[0037] Specifically, according to the intersection information, the event system is triggered and analyzed. When the interaction status between the input device and the user interface element is obtained, the script accesses Unity's EventSystem component and drives a series of callback functions or internal methods through PointerEventData to identify the specific interaction stage of the user. The event system will judge various event types such as pointer entry, pointer exit, click down, click up, etc. according to the UI element hit by the ray, and trigger the corresponding interface or script function, such as IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler, etc. During the trigger analysis and processing, the system will read the UI object information hit in RaycastResult, and combine the pointerId, clickCount and other fields in PointerEventData to confirm whether complex interactive behaviors such as dragging, double-clicking or long pressing occur. At this time, if the target UI element has an interaction level tag, the script can identify that the element belongs to a specific logical group, thereby determining the type of event and response method that should be triggered. When certain interactive states are detected, the event system will call callback functions such as OnPointerEnter or OnPointerClick of the corresponding script, triggering visual changes in the interface, sound feedback, or the execution of logical operations. After the analysis is completed, the script generates conclusions about the interactive state of the input device and the user interface element by reading the current PointerEventData state of the event system, such as the current pointer is hovering over an object with a specific level mark or the current click operation is being performed on an interactive control. The interactive state obtained in this way can play a practical role in the movement restriction logic or other functional modules, helping the system to determine when to block the character movement or switch functions based on the state information, and realize a more accurate and flexible game interaction process.
[0038] 103. Based on the position relationship information, the movement control logic of the game character in the virtual environment is dynamically adjusted to achieve movement restriction of the game character.
[0039] In one embodiment of the present invention, the movement control logic of the game character in the virtual environment is dynamically adjusted based on the position relationship information to achieve the movement restriction of the game character, including: updating the state of the game character's movement controller according to the position relationship information to obtain the current movement state of the game character; judging the validity of the movement input of the game character based on the current movement state to obtain the validity result of the movement input; adjusting the movement behavior of the game character according to the validity result to obtain an adjusted movement control signal; and executing the movement restriction of the game character based on the adjusted movement control signal to obtain the movement restriction output of the game character.
[0040] Specifically, according to the position relationship information, the mobile controller of the game character is updated to obtain the current mobile state of the game character. After detecting the interaction results from the UI ray detection and event system, the script determines the relationship between the input device and the specific hierarchical mark UI element, and decides whether the character enters the restricted mode accordingly. When executed, the character controller is usually composed of a third-person or first-person script, which manages the acceleration, orientation, and animation switching of the character. When the position relationship information shows that the input device is located in the interactive UI area, the script switches the internal identification of the mobile controller to "InteractionLocked" or a similarly named state, and temporarily sets the properties such as the movement speed and rotation angle to zero or a specific low threshold, so that the character is restricted in the subsequent movement calculation stage. This state update process often defines multiple character states in the script through enumeration or string constants. When the script executes Update or FixedUpdate in each frame, it first reads the position relationship information, then assigns or switches the controller state, and uses object-oriented programming to maintain the flexibility and controllability of the character. At this point, if the character is in a normal state, the script will maintain or restore the normal movement parameters to allow the character to continue walking, running or turning; if it is detected that the character should disable input, the script will put the controller into a restricted state and trigger an internal Flag update so that subsequent links can further check and filter the movement data.
[0041] Specifically, based on the current movement state, the game character's movement input is processed for validity judgment. When the validity result of the movement input is obtained, the script will compare the input signals of the keyboard, mouse or handle one by one in the core logic of the character controller. The specific implementation method includes reading values such as Axis and Button from the Input class or the custom input manager, and matching them with the internal status field of the character controller. If the status field shows that the character is currently in restricted mode, the script will set the read movement direction, rotation direction or other action instructions to invalid, and process them as zero vectors or Boolean false values; if the status field shows that the character is in normal state, the script will retain the input and enter normal kinematics or animation calculations. In this way, the movement input when restricted will not be further processed by the controller, avoiding the scene where the character can still move freely during the UI interaction process. The validity result is usually stored in a local variable or a temporary structure. The script may indicate whether the input can be executed with a Boolean value or an enumeration type, and will mark the name or value of the specific input axis, so that the downstream module can know whether this input information should be ignored, weakened or fully accepted. This judgment process will be performed in each frame or at a fixed refresh rate, so that the character can immediately respond to the UI interaction status during real-time operations, maintaining the timeliness and consistency of game interactions.
[0042] Specifically, according to the validity result, the movement behavior of the game character is adjusted and processed. When the adjusted movement control signal is obtained, the script will make a further numerical correction to the input just judged to be valid or invalid in the motion calculation link of the character controller. If the input is deemed invalid, the script will force the character's velocity vector and rotation vector to zero or set a very small value to prohibit the character from moving significantly in the scene; if the input is deemed valid, the script will calculate the final movement vector and rotation angle of the character in a conventional way, and then write the result into the subsequent animation or physical component. This adjustment process often uses an interpolation algorithm or a smooth transition function to avoid the abrupt feeling caused by instantaneous switching when the character enters or exits the restricted mode. The script may reduce the speed in the restricted to prohibited range and complete the gradual change of the character's direction in a limited time window to make the visual effect more natural. At this time, if the multiplayer or server synchronization mechanism is also running, the script will package the adjusted movement control signal and send it to the network module so that other clients can receive the current real state of the character in time. The main operations included in the adjustment process include resetting the character's horizontal speed, vertical speed, angular speed, and additional modifications to the character animation parameters when necessary, such as keeping the character in a standby action or switching to an interactive pose. After the processing is completed, the script returns the adjusted signal to the core scheduling logic of the character controller to provide controllable movement data for the final execution link.
[0043] Specifically, based on the adjusted movement control signal, the movement restriction of the game character is executed and processed. When the movement restriction output of the game character is obtained, the script will convert the above signal into a direct operation of the Transform or CharacterController component in each frame or each physical update call, and link with Unity's Animator or Rigidbody. The execution process includes updating the displacement and rotation on the character Transform, or calling the CharacterController.Move function to apply the final movement vector to the character collision body. If the speed and angle in the movement signal are both zero, the character will remain stationary on the screen to reflect the effectiveness of the restricted state; if the movement signal partially restores the normal value, the character can make small movements or turn around within the specified range to support some semi-restricted interaction scenes. After the script is executed, it will update the position and state of the character in the scene, and write the new animation parameters or physical state back to the internal controller field to provide real data for the calculation of the next frame or the next physical cycle. At this point, if the UI interaction ends or the input device is detected to have left the specified interface element, the script will reset the movement restriction logic in the subsequent loop and restore the movement signal to normal levels to ensure that the character can walk freely or issue combat commands again. In this way, the game character's movement restriction output can always change dynamically with the position relationship information and real-time input conditions, achieving a more stable interaction experience and flexible character movement control.
[0044] Furthermore, the movement behavior of the game character is adjusted according to the validity result to obtain an adjusted movement control signal, including: performing threshold comparison processing on the validity result to obtain an adjustment strategy for the movement behavior; performing correction calculation processing on the movement parameters of the game character according to the adjustment strategy to obtain a corrected movement parameter set; based on the corrected movement parameter set, the kinematic model of the game character is updated to obtain an updated movement state; according to the updated movement state, instruction generation processing is performed on the movement controller of the game character to obtain an adjusted movement control signal.
[0045] Specifically, when the threshold comparison processing is performed on the validity result and the adjustment strategy of the movement behavior is obtained, the script will compare the amplitude or frequency of the current input instruction according to the predefined numerical threshold inside the character controller, and map the comparison result to the corresponding strategy type. The implementation method is usually to set several interval ranges in the C# code, and each interval corresponds to a different movement behavior adjustment scheme. Assuming that the strength of the movement input axis is in an extremely low range, the script determines the result as "invalid" or "weakly valid" type. If the strength is in a high range, it is regarded as "executable" or "partially restricted" type. At this time, the character controller will collect the value of the movement input in each frame or fixed update frequency, and call a special function to perform threshold comparison processing on the value. If the value exceeds a certain upper limit or is lower than a certain lower limit, the script will mark a corresponding strategy type for the input and store the mark in the state management field of the controller. The threshold comparison processing can ensure that the character's movement instructions can still maintain the expected behavior characteristics in different environments or different device sensitivities. For example, when the input value in one direction is less than 0.1, the adjustment strategy may specify that the character enters a stagnant or extremely slow movement mode, and when the input value exceeds 0.8, the character can maintain normal movement or a higher speed walking state. In order to make the judgment process more flexible, the script sometimes introduces interpolation or weighted calculations to merge input signals of multiple dimensions together, and then perform multi-dimensional comparisons with the threshold table to produce a more refined classification of movement strategies. After completing the threshold comparison, the character's behavior adjustment strategy will be mapped into a set of readable constants or enumerations in the code, and subsequent steps can rely on this strategy type to make more specific corrections and controls to the character's movement parameters.
[0046] Specifically, according to the adjustment strategy, the movement parameters of the game character are corrected and calculated. When the corrected movement parameter set is obtained, the script will refer to the strategy type generated in the previous stage to perform numerical corrections on the character's movement speed, acceleration, rotation angle, and animation mixing ratio. The correction calculation is usually implemented by a set of special functions, which read the current motion parameters of the character and determine the direction and magnitude of the correction according to the adjustment strategy. If the strategy result is "invalid input", the script will clear or significantly reduce the speed vector, so that the character cannot move effectively in the scene; if the strategy result is "partial restriction", the script will reduce the speed or rotation amount by a certain proportion to ensure that the character can perform slight walking but cannot run at high speed. In some cases, the correction calculation will also affect the character's vertical movement or jumping ability, such as prohibiting the character's jumping command during UI interaction to avoid interrupting the interaction process. When the script performs this correction, it often uses an interpolation function or a smooth transition algorithm to make the character's movement gradually approach the target range in terms of value without causing a sudden stop or acceleration. This can improve the visual comfort of the character's movement and avoid frequent state jitter. After the correction is completed, the script will combine the obtained velocity vector, rotation vector, acceleration coefficient, etc. into a new parameter set and store it in the internal field of the character controller so that it can be read uniformly in the subsequent kinematic model update stage. This process will also consider factors such as the character's body part weights and the transition priority of the animation blend tree in some advanced settings, so that the character's animation performance is closely integrated with the actual movement effect and is as smooth and natural as possible. The corrected parameter set generated in this way can provide more controllable data input for subsequent kinematic model updates.
[0047] Specifically, based on the modified movement parameter set, the kinematic model of the game character is updated. When the updated movement state is obtained, the script will recalculate each joint or collision body according to the kinematic solution method used by the character in the scene, so as to obtain accurate character posture and position transformation. If the character is driven by root motion animation, the script will match the modified speed value or movement direction with the animation timeline, and appropriately adjust the movement displacement when the character model plays walking, running and other actions, so that the character movement in the game screen is consistent with the animation rhythm. If the character uses physical operations based on the CharacterController component, the script will call the Move or SimpleMove method to apply the modified movement vector to the displacement of the collision body, while maintaining the character's orientation and gravity influence at the logical level. The kinematic model update process usually includes steering interpolation calculations so that the character is only allowed to rotate at a small angle when the command is restricted, and returns to the normal direction change speed after the command is restored. In some implementations, the script will also reference Inverse Kinematics to process the joint arrangement of the character's upper and lower limbs, so that the character can present appropriate hand or body postures during UI interaction. Doing so can make the visual performance more consistent with the restricted state and maintain the coordination between the character's local action and global movement. After the kinematic model is updated, a new motion state description will be generated inside the character controller, including the character's world coordinates in the scene, rotation angle, animation playback progress, collision body position and other information. This state will be handed over to the next stage of instruction generation, so that the system can issue the final movement or restriction instructions for the character according to this state.
[0048] Specifically, according to the updated motion state, the game character's mobile controller is processed for command generation. When the adjusted mobile control signal is obtained, the script will use the motion state data generated in the previous step as input, issue the final move or stop command to the character controller, and update it to the network or animation system synchronously. This command generation method is usually defined by defining a core function in the character control script, which formats the updated velocity vector and rotation value, and then passes it to interfaces such as CharacterController.Move or Animator.SetFloat. If the character uses Rigidbody for physical drive, the script will also call APIs such as AddForce or MovePosition to ensure that the character's coordinates in the physical world meet the revised parameter set. The command generation process will also start or stop certain animation events when necessary, such as switching the character's walking, running, standby and other actions to match the new state. The generated mobile control signal often needs to be serialized and sent to other clients when the network is online to synchronize the character's restricted or free movement. In the local client scenario, after the script executes these instructions, the character will show a new movement form or stop posture on the screen. If the UI interaction is still going on, the character will still maintain restricted behavior; when the UI interaction ends or the threshold comparison derives a recovery strategy, the instructions will also be restored to normal accordingly. The adjusted movement control signal generated in this way can not only accurately reflect the result of the judgment on the validity of the input, but also cooperate with the character kinematic model to present movement performance that meets the needs of the scene, and ultimately make the character's behavior in UI interaction or special restricted situations more in line with expectations.
[0049] In this embodiment, by performing hierarchical marking processing on the user interface elements in the virtual environment, a set of user interface elements with preset hierarchical markings is obtained; based on the set of user interface elements, the position information of the input device is detected and analyzed in real time to obtain the position relationship information between the input device and the user interface elements; based on the position relationship information, the movement control logic of the game character in the virtual environment is dynamically adjusted to achieve movement restrictions on the game character. This method accurately identifies complex and changing UI environments through dynamic marking and real-time detection of UI elements, and adjusts the movement control logic of the game character accordingly. This method solves the problem that traditional fixed layouts and simple collision detection cannot accurately control the movement of game characters in complex UI environments, and improves the accuracy and fluency of game interactions.
[0050] The above describes the method for limiting the movement of a game character in an embodiment of the present invention. The following describes the device for limiting the movement of a game character in an embodiment of the present invention. Figure 2 In one embodiment of the present invention, a device for limiting the movement of a game character includes: The marking module 201 is used to perform hierarchical marking processing on the user interface elements in the virtual environment to obtain a set of user interface elements with preset hierarchical markings; A detection module 202, configured to perform real-time detection and analysis on the position information of the input device according to the set of user interface elements, and obtain position relationship information between the input device and the user interface elements; The control module 203 is used to dynamically adjust the movement control logic of the game character in the virtual environment based on the position relationship information to achieve movement restriction of the game character.
[0051] In an embodiment of the present invention, the game character movement restriction device runs the above-mentioned game character movement restriction method, and the game character movement restriction device obtains a set of user interface elements with preset hierarchical markings by performing hierarchical marking processing on the user interface elements in the virtual environment; based on the set of user interface elements, the position information of the input device is detected and analyzed in real time to obtain the position relationship information between the input device and the user interface element; based on the position relationship information, the movement control logic of the game character in the virtual environment is dynamically adjusted to achieve the movement restriction of the game character. This method accurately identifies complex and changing UI environments through dynamic marking and real-time detection of UI elements, and adjusts the movement control logic of the game character accordingly. This method solves the problem that traditional fixed layouts and simple collision detection cannot accurately control the movement of game characters in complex UI environments, and improves the accuracy and fluency of game interactions.
[0052] above Figure 2 The game character movement restriction device in the embodiment of the present invention is described in detail from the perspective of modular functional entities, and the game character movement restriction device in the embodiment of the present invention is described in detail from the perspective of hardware processing.
[0053] Figure 3 3 is a schematic diagram of the structure of a game character movement restriction device provided by an embodiment of the present invention. The game character movement restriction device 300 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 310 (for example, one or more processors) and a memory 320, and one or more storage media 330 (for example, one or more mass storage device terminals) storing application systems 333 or data 332. Among them, the memory 320 and the storage medium 330 can be short-term storage or permanent storage. The system stored in the storage medium 330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the game character movement restriction device 300. Furthermore, the processor 310 can be configured to communicate with the storage medium 330, and execute a series of instruction operations in the storage medium 330 on the game character movement restriction device 300 to implement the steps of the above-mentioned game character movement restriction method.
[0054] The game character movement restriction device 300 may also include one or more power supplies 340, one or more wired or wireless network interfaces 350, one or more input and output interfaces 360, and / or one or more operating systems 331, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Figure 3 The structure of the game character movement restriction device shown does not constitute a limitation on the game character movement restriction device provided by the present invention, and may include more or less components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0055] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the game character movement restriction method.
[0056] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device, or unit can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0057] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store system code.
[0058] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.< / t> < / t> < / gameobject>
Claims
1. A method for limiting the movement of a game character, characterized in that: The method for limiting the movement of game characters comprises: Performing hierarchical marking processing on the user interface elements in the virtual environment to obtain a set of user interface elements with preset hierarchical markings; According to the user interface element set, real-time detection and analysis are performed on the position information of the input device to obtain position relationship information between the input device and the user interface element; Based on the position relationship information, the movement control logic of the game character in the virtual environment is dynamically adjusted to achieve movement restriction of the game character.
2. The method for limiting the movement of a game character according to claim 1, characterized in that: The step of performing hierarchical marking processing on the user interface elements in the virtual environment to obtain a set of user interface elements with preset hierarchical markings includes: Traverse and process each user interface element in the virtual environment to obtain a list of user interface elements; According to a predefined hierarchical rule, each user interface element in the user interface element list is assigned a preset hierarchical mark or a logical group to obtain a user interface element with a hierarchical mark; The user interface elements with the hierarchical marks are classified and sorted to obtain a set of user interface elements with preset hierarchical marks.
3. The method for limiting the movement of a game character according to claim 2, characterized in that: The step of assigning a preset hierarchical mark or logical group to each user interface element in the user interface element list according to a predefined hierarchical rule to obtain a user interface element with a hierarchical mark includes: Traversing the user interface element list to obtain the user interface element currently to be processed; According to the attribute information of the user interface element to be processed, matching and analyzing the predefined hierarchical rules are performed to obtain the corresponding hierarchical mark type; Based on the hierarchical mark type, a mark assignment process is performed on the current user interface element to be processed to obtain a user interface element with a corresponding hierarchical mark.
4. The method for limiting the movement of a game character according to claim 1, characterized in that: The step of performing real-time detection and analysis on the position information of the input device according to the set of user interface elements to obtain the position relationship information between the input device and the user interface element comprises: Perform real-time monitoring and processing on the position of the input device on the screen to obtain real-time position data of the input device; According to the real-time position data of the input device, the user interface element is detected by using the event system and the graphic ray detector to obtain the interaction state between the input device and the user interface element; Based on the interaction state, the positional relationship between the input device and the user interface element with a specific level mark is determined and processed to obtain positional relationship information between the input device and the user interface element.
5. The method for limiting the movement of game characters according to claim 4, characterized in that: The detecting of the user interface element by using the event system and the graphic ray detector according to the real-time position data of the input device to obtain the interaction state between the input device and the user interface element comprises: Based on the real-time position data of the input device, the virtual camera is subjected to perspective conversion processing to obtain the starting point and direction of the ray in the world space; Using the starting point and direction of the ray, initializing and configuring the graphic ray detector to obtain a configured ray detector; Using the configured ray detector, perform ray projection processing on the user interface elements in the virtual environment to obtain intersection information between the ray and the user interface elements; According to the intersection information, the event system is triggered and analyzed to obtain the interaction status between the input device and the user interface element.
6. The method for limiting the movement of a game character according to claim 1, characterized in that: The dynamically adjusting the movement control logic of the game character in the virtual environment based on the position relationship information to achieve movement restriction of the game character includes: According to the position relationship information, a state update process is performed on the mobile controller of the game character to obtain the current mobile state of the game character; Based on the current movement state, the game character's movement input is subjected to validity judgment processing to obtain a validity result of the movement input; According to the validity result, adjusting the movement behavior of the game character to obtain an adjusted movement control signal; Based on the adjusted movement control signal, the movement restriction of the game character is executed and processed to obtain the movement restriction output of the game character.
7. The method for limiting the movement of a game character according to claim 6, characterized in that: The step of adjusting the movement behavior of the game character according to the validity result to obtain an adjusted movement control signal includes: Performing threshold comparison processing on the effectiveness result to obtain an adjustment strategy for the movement behavior; According to the adjustment strategy, the movement parameters of the game character are corrected and calculated to obtain a corrected movement parameter set; Based on the modified movement parameter set, the kinematic model of the game character is updated to obtain an updated movement state; According to the updated motion state, the movement controller of the game character is processed by command generation to obtain an adjusted movement control signal.
8. A device for limiting the movement of a game character, characterized in that: The game character movement restriction device comprises: A marking module, used to perform hierarchical marking processing on the user interface elements in the virtual environment to obtain a set of user interface elements with preset hierarchical markings; A detection module, used to perform real-time detection and analysis on the position information of the input device according to the set of user interface elements, and obtain position relationship information between the input device and the user interface elements; The control module is used to dynamically adjust the movement control logic of the game character in the virtual environment based on the position relationship information to achieve movement restriction of the game character.
9. A device for limiting the movement of a game character, characterized in that: The game character movement restriction device comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instructions in the memory to enable the game character movement restriction device to execute the steps of the game character movement restriction method according to any one of claims 1-7.
10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the steps of the method for limiting the movement of a game character as described in any one of claims 1-7 are implemented.
Citation Information
Patent Citations
Game task guiding completion method, system and device
CN112107854A
AI role control method and device in game
CN113827974A
Virtual character movement control method and device, electronic equipment and storage medium
CN114870399A
Game role control method and device and electronic equipment
CN116115994A
Interaction operation response method and device, computer equipment and storage medium
CN117032540A