Virtual character following movement method, device, and storage medium
By constructing a virtual space in the AR experience, obtaining the real-time location of the user and the virtual character, and adjusting the state and path of the virtual character, the problem of users having difficulty perceiving the existence of the virtual character is solved, and a better interactive experience is achieved.
Patent Information
- Application Number
- CN202211686931.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-27
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2042-12-27
AI Technical Summary
In AR experiences, users often find it difficult to perceive the presence of virtual characters, especially when there are obstacles in the real space. This makes it hard to accurately determine the movement range of the virtual characters, resulting in a poor user experience.
By constructing a virtual space, the real-time positions of the user and the virtual character are obtained, the straight-line distance is calculated, and when the distance exceeds a preset value, the virtual character's state is adjusted to a moving state, a movement path is planned, and the character moves to the target location. After that, the virtual character is adjusted to a standby state to follow the user character.
Users can see and perceive the existence of virtual characters more intuitively, which improves the interactive experience and enhances the interactivity with virtual characters.
Smart Images

Figure CN116236783B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and specifically to a method, device, and storage medium for a virtual character to follow movement. Background Technology
[0002] Large-space AR technology overlays virtual content onto real-world spaces, allowing users to see and interact with the virtual content as they move freely within the real environment. In certain scenarios, this technology addresses the need for virtual content to move with the user, such as virtual guides or virtual pets.
[0003] The interactive feature of a character following another is frequently used in many games, such as pets or teammates following each other. In such scenarios, there are usually two characters: one is a freely movable character controlled by the user, and the other is a virtual character that follows. When the user moves one character freely, the other character follows behind at a certain distance. In mobile AR experiences, the freely movable character is the user themselves. When the user walks in real space with the mobile device, a virtual character in the AR space will move along with the user.
[0004] In traditional games, the virtual character follows the user from behind, not in front. However, unlike traditional games, in AR experiences, users only see virtual content in front of the mobile device screen, not a 360-degree panorama. Therefore, using traditional methods, users would find it difficult to perceive the virtual character's presence. Furthermore, the presence of walls or other obstacles in real-world spaces makes it difficult to accurately determine the virtual character's movement range and respond accordingly, resulting in a poor user experience. Summary of the Invention
[0005] To address the aforementioned issues, embodiments of this application provide a method, device, and storage medium for a virtual character to follow movement, allowing users to see and perceive the existence of the virtual character and interact with it.
[0006] Therefore, one aspect of this application provides a method for a virtual character to follow movement, the method comprising the following steps:
[0007] Step S1: Construct a virtual space and virtual characters and user characters, obtain the real-time position between the user characters and the virtual characters, and calculate the straight-line distance between the user characters and the virtual characters;
[0008] Step S2: Determine whether the straight-line distance exceeds a preset value. When the straight-line distance exceeds the preset value, adjust the state of the virtual character to a moving state, and the virtual character moves towards the target position.
[0009] Step S3: When the virtual character is located at the target location, detect the user's current movement state, adjust the virtual character's state to standby state, and follow the user character.
[0010] Optionally, in conjunction with any of the above aspects, in another implementation of this aspect, in step S2, the virtual character moves toward the target location, specifically as follows:
[0011] The real-time positions of the virtual character and the user character are updated at each preset time. Based on the real-time positions of the virtual character and the user character, the movement path of the virtual character is automatically planned, and the virtual character is moved according to the movement path until the virtual character reaches the target position.
[0012] Optionally, in conjunction with any of the above aspects, in another implementation of this aspect, the step of automatically planning the movement path of the virtual character based on the real-time location of the virtual character and the user character specifically involves:
[0013] The system obtains the current position of items within a preset range that the user character is facing, determines whether there are obstacles within the preset range, and sets the target point of the virtual character's movement path to the user character's designated position when there are no obstacles. The system then moves the virtual character according to the shortest movement path between the target point and the virtual position in real time.
[0014] Optionally, in conjunction with any of the above aspects, in another implementation of this aspect, when there is an obstacle within the preset range, the intersection of the ray emitted by the user character along the current direction and the obstacle is set as the target point of the virtual character's movement path, and the virtual character is moved according to the shortest movement path between the target point and the real-time position of the virtual location.
[0015] Optionally, in conjunction with any of the above aspects, in another implementation of this aspect, the step of automatically planning the movement path of the virtual character based on the real-time location of the virtual character and the mobile terminal further includes determining whether the distance moved by the user character within the preset time period is greater than a threshold based on the real-time location of the user character updated within the preset time period. If the distance moved by the user character is greater than the threshold, the user character maintains the moving state, and the state of the virtual character remains consistent with that of the user character.
[0016] Optionally, in conjunction with any of the above aspects, in another implementation of this aspect, when the virtual character is not within the virtual space displayed by the mobile terminal user interface, a preset animation icon is displayed at a preset position on the mobile terminal user interface, and the preset position matches the position of the virtual character.
[0017] Optionally, in combination with any of the above aspects, in another implementation of this aspect, the character state includes a moving state and a standby state, wherein the moving state is when the virtual character moves with the user character, and the standby state is when the virtual character follows the user character within a preset angle.
[0018] In another aspect of this application, an electronic device is provided, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a virtual character following movement method as described above.
[0019] In another aspect of this application, a storage medium is provided having a computer program stored thereon, which, when executed, implements a virtual character following movement method as described above.
[0020] As described above, this application provides a method, device, and storage medium for a virtual character to follow movement. The method involves acquiring the real-time position between the user character and the virtual character, calculating the straight-line distance between them, and when the straight-line distance exceeds a preset value, adjusting the virtual character's state to a moving state. The virtual character moves towards a target location until it reaches that location, at which point the virtual character's state is adjusted to a standby state, following the user character. Through this method, the user can consistently see and perceive the virtual character's presence, making it easier to interact with it.
[0021] The above summary provides a simplified overview of some concepts, which will be further described in detail in the following specific embodiments. The above summary is not intended to identify key or essential features of the claimed subject matter, nor is it intended to help determine the scope of the claimed subject matter. The claimed subject matter is not limited to embodiments that address any or all the shortcomings pointed out in the background art. Attached Figure Description
[0022] The accompanying drawings, incorporated in and forming part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without any creative effort. These drawings and textual descriptions are not intended to limit the scope of the concept of this application in any way, but rather to illustrate the concepts of this application to those skilled in the art by referring to specific embodiments.
[0023] Figure 1A flowchart illustrating a virtual character following movement method provided in this application;
[0024] Figure 2 A schematic diagram of route planning for a virtual character following movement method provided in this application;
[0025] Figure 3 This is a schematic diagram of the preset animation identifier for the user interface of a virtual character following movement method provided in this application. Detailed Implementation
[0026] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0027] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, components, features, and elements with the same names in different embodiments of this application may have the same meaning or different meanings, the specific meaning of which must be determined by its interpretation in that specific embodiment or further in conjunction with the context of that specific embodiment.
[0028] It should be understood that although the terms first, second, third, etc., may be used herein to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this document, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if," as used herein, may be interpreted as "when," "when," or "in response to determination." Furthermore, as used herein, the singular forms "a," "an," and "the" are intended to also include the plural forms unless the context indicates otherwise. It should be further understood that the terms "comprising," "including," indicate the presence of the stated feature, step, operation, element, component, item, kind, and / or group, but do not exclude the presence, occurrence, or addition of one or more other features, steps, operations, elements, components, items, kinds, and / or groups. The terms "or," "and / or," "including at least one of the following," etc., as used in this application, may be interpreted as inclusive, or mean any one or any combination thereof. An exception to this definition will only occur if the combination of elements, functions, steps, or operations is inherently mutually exclusive in some way.
[0029] It should be understood that although the steps in the flowcharts of this application's embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.
[0030] Depending on the context, the words “if” or “suppose” as used here can be interpreted as “when” or “in response to determination” or “in response to detection.” Similarly, depending on the context, the phrases “if determination” or “if detection (of the stated condition or event)” can be interpreted as “when determination” or “in response to determination” or “when detection (of the stated condition or event)” or “in response to detection (of the stated condition or event).”
[0031] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0032] Please see Figure 1 This application provides a method for virtual characters to follow movement, allowing users to intuitively see and perceive the existence of virtual characters through mobile terminals and interact with them.
[0033] Specifically, this method includes the following steps:
[0034] Step S1: Construct a virtual space, virtual characters, and user characters; obtain the real-time positions of the user characters and the virtual characters; and calculate the straight-line distance between the user characters and the virtual characters. The virtual space is a model space formed by scanning and modeling the user's real environment through a mobile terminal. Virtual content can be placed inside the virtual space and overlaid onto the real space using AR technology.
[0035] The user sets up a role within this virtual space using a mobile terminal, which can be freely moved by the user. The virtual character follows the user character; when the user walks in the real space holding the mobile terminal, the virtual character moves accordingly within the virtual space. The real-time positions of the user character and the virtual character are obtained within the virtual space, and the straight-line distance D between them is determined based on these real-time positions.
[0036] Step S2: Determine whether the straight-line distance exceeds a preset value. When the straight-line distance exceeds the preset value, adjust the state of the virtual character to a moving state, and the virtual character moves towards the target position.
[0037] The state of the virtual character needs to be switched based on the straight-line distance. The virtual character exists in two states in the virtual space: a moving state and a standby state. The moving state means the virtual character moves following the user character's movement or commands issued by the user character. The standby state means the virtual character follows the user character within a preset angle. When the distance between the user character and the virtual character is large, the virtual character needs to follow, and the user can perceive the virtual character's presence through the mobile terminal's display interface. The preset value can be set according to the size of the virtual space and the user's preferences. In this application, the preset value can be set to 5m. When the straight-line distance is greater than 5m, the virtual character switches to the moving state and moves towards the target location.
[0038] The virtual character moves toward the target location, specifically...
[0039] The real-time positions of the virtual character and the user character are updated at each preset time. Based on the real-time positions of the virtual character and the mobile terminal, the movement path of the virtual character is automatically planned, and the virtual character is moved according to the movement path until the virtual character reaches the location of the mobile terminal.
[0040] like Figure 2As shown in the diagram, the IP address represents the location of the virtual character, and the arrow direction indicates the orientation of the user's mobile terminal, which is also the orientation of the user character. When the real-time positions of the user character and the virtual character exceed a preset value, the virtual character moves towards the user character. Simultaneously, based on the user character's real-time position updated within the preset time period, it is determined whether the distance the user character has moved within that time period exceeds a threshold. If the distance exceeds the threshold, the user character remains in motion, and the virtual character's state remains consistent with the user character. The preset time and threshold can be set according to user preferences or the size of the virtual space. The preset time is typically set to 2 seconds, and the threshold is set to 1 meter. This means that when the user character moves a distance greater than 1 meter within 2 seconds, the user character remains in motion, and the virtual character also remains in motion, mirroring the user character.
[0041] The system automatically plans the movement path of the virtual character based on the real-time location of the virtual character and the mobile terminal. First, it obtains the positions of items within a preset range that the user character is currently facing. It then determines whether there are obstacles within the preset range. If there are no obstacles, the target point of the virtual character's movement path is set to the user character's specified location. The virtual character then moves according to the shortest path between the target point and the virtual character's real-time location. If obstacles exist within the preset range, such as... Figure 2 In T2, the intersection of the ray emitted by the user character along the current direction and the obstacle is set as the target point of the virtual character's movement path. The virtual character is then moved according to the shortest movement path between the target point and the real-time position of the virtual location, thereby avoiding the obstacle.
[0042] Step S3: When the virtual character is located at the target location, detect the user's current movement state, adjust the virtual character's state to standby state, and follow the user character.
[0043] Once the virtual character reaches the target location, the user's current movement is detected by monitoring the user's real-time position over a preset time period. If the user's movement does not exceed a threshold within this time period, the user is considered to be in standby mode, and the virtual character's state is adjusted to standby mode to follow the user. In standby mode, the virtual character's head and eyes will maintain a 180-degree following position towards the user.
[0044] Furthermore, when the virtual character is not within the virtual space displayed by the mobile terminal user interface, such as... Figure 3As shown, a preset animated icon is displayed at a preset position on the mobile terminal's user interface. The preset position matches the position of the virtual character, and is generally displayed with a floating animation on the left and right sides of the mobile terminal's user interface to avoid obscuring other important information on the mobile terminal, while also increasing the fun of the virtual character following.
[0045] This application provides a method, device, and storage medium for a virtual character to follow movement. The method involves acquiring the real-time position between the user character and the virtual character, calculating the straight-line distance between them, and when the straight-line distance exceeds a preset value, adjusting the virtual character's state to a moving state. The virtual character moves towards a target location until it reaches that location, at which point the virtual character's state is adjusted to a standby state, following the user character. Through this method, the user can consistently see and perceive the virtual character's presence, making it easier to interact with it.
[0046] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0047] In this application, the same or similar terms, concepts, technical solutions and / or application scenario descriptions are generally described in detail only when they appear for the first time. When they appear again, they are generally not repeated for the sake of brevity. When understanding the technical solutions and other contents of this application, the same or similar terms, concepts, technical solutions and / or application scenario descriptions that are not described in detail later can be referred to their previous relevant detailed descriptions.
[0048] In this application, the descriptions of the various embodiments have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0049] The technical features of the present application can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the present application.
[0050] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be an electrical device or a network device, etc.) to execute the methods of each embodiment of this application.
[0051] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for virtual character following movement, characterized in that, This method includes the following steps: Step S1: Construct a virtual space and virtual characters and user characters, obtain the real-time position between the user characters and the virtual characters, and calculate the straight-line distance between the user characters and the virtual characters; Step S2: Determine whether the straight-line distance exceeds a preset value. When the straight-line distance exceeds the preset value, adjust the state of the virtual character to a moving state, and the virtual character moves towards the target position. Step S3: When the virtual character is located at the target location, detect the user's current movement state, adjust the virtual character's state to standby state, and follow the user character; In step S2, the virtual character moves toward the target location, specifically, The real-time positions of the virtual character and the user character are updated at each preset time. Based on the real-time positions of the virtual character and the user character, the movement path of the virtual character is automatically planned, and the virtual character is moved according to the movement path until the virtual character reaches the target position. The step of automatically planning the movement path of the virtual character based on the real-time location of the virtual character and the user character specifically involves: The system obtains the current position of items within a preset range that the user character is facing, determines whether there are obstacles within the preset range, and sets the target point of the virtual character's movement path to the specified position of the user character when there are no obstacles. The system then moves the virtual character according to the shortest movement path between the target point and the real-time position of the virtual position. If there is an obstacle within the preset range, the intersection of the ray emitted by the user character along the current direction and the obstacle is set as the target point of the virtual character's movement path, and the virtual character is moved according to the shortest movement path between the target point and the real-time position of the virtual location. The step of automatically planning the movement path of the virtual character based on the real-time location of the virtual character and the mobile terminal also includes determining whether the distance moved by the user character within the preset time period is greater than a threshold based on the real-time location of the user character updated within the preset time period. If the distance moved by the user character is greater than the threshold, the user character maintains the moving state, and the state of the virtual character is consistent with that of the user character.
2. The virtual character following movement method as described in claim 1, characterized in that: When the virtual character is not within the virtual space displayed by the mobile terminal user interface, a preset animation icon is displayed at a preset position on the mobile terminal user interface, and the preset position matches the position of the virtual character.
3. The virtual character following movement method as described in claim 1, characterized in that: The character state includes a moving state and a standby state. The moving state is when the virtual character moves with the user character, and the standby state is when the virtual character follows the user character within a preset angle.
4. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements a virtual character following movement method as described in any one of claims 1 to 3.
5. A storage medium, characterized in that, It stores a computer program, which, when executed, implements a virtual character following movement method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Control method and device for calling object in virtual scene, equipment and storage medium
CN113181650A
Virtual scene-based co-shooting processing method, apparatus and device, and storage medium
CN114344896A
Picture display method and device, electronic equipment and readable storage medium
CN114632326A
Cited By
An artificial intelligence-based virtual character real-time perception and action decision method
CN122527744A