Virtual object switching method, apparatus, computer device, and computer program

The method and device facilitate efficient lock-on target switching in virtual environments by using shake operations on mobile terminals, improving user interaction and strategic gameplay efficiency.

JP2024538553AInactive Publication Date: 2024-10-23TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 23 Cites 0 Cited by

Patent Information

Application Number
JP2024518461
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2021-12-10
Filing Date
2022-10-24
Publication Date
2024-10-23
Estimated Expiration
Not applicable · inactive patent

Smart Images

  • Figure 2024538553000001_ABST
    Figure 2024538553000001_ABST
Patent Text Reader

Abstract

The present application discloses a method, an apparatus, a device, a medium and a program product for switching virtual objects, which belong to the field of virtual environment technology. The method includes a step of displaying (220) a first virtual object in a locked-on state and a second virtual object not in a locked-on state, a step of receiving (240) a shake operation, and a step of switching (260) the first virtual object in the locked-on state to the second virtual object when the shake operation matches with the second virtual object. This method can improve the user's efficiency in switching the lock-on target.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] This application claims priority to a Chinese patent application filed on December 10, 2021, bearing application number 202111506115.4, and titled "Virtual object switching method, device, equipment, medium and program product," the entire contents of which are incorporated herein by reference.

[0002] TECHNICAL FIELD The embodiments of the present application relate to the field of virtual environment technology, and in particular to a method, an apparatus, an equipment, a medium and a program product for switching virtual objects. [Background technology]

[0003] In various games, a user must lock on to one enemy character from among several enemy characters to attack, and must often switch the enemy character to be locked on during battle.

[0004] In a related technology, a lock-on controller is set in a user interface, and when a user touches the lock-on controller for the first time, the terminal automatically locks on to a first enemy character from among several enemy characters, and when the user touches the lock-on controller again, the terminal switches from the first enemy character to a second enemy character and locks on to them in a preset switching order.

[0005] However, if switching between enemy characters to lock on to is performed based solely on a preset switching order, when the enemy character the user wants to attack is last in the switching order, the related technology requires multiple touches of the lock-on controller to perform the switching, resulting in low efficiency in character switching. Summary of the Invention [Problem to be solved by the invention]

[0006] The present application provides a method, device, equipment, medium and program product for switching virtual objects. The technical solutions are as follows: [Means for solving the problem]

[0007] According to one aspect of the present application, there is provided a method for switching a virtual object, the method being executed by a mobile terminal, the method comprising: displaying a first virtual object in a locked-on state and a second virtual object that is not in a locked-on state, the locked-on state indicating that the locked-on virtual object is a target for an action of a master control virtual object; receiving a shake operation, the shake operation being an operation of shaking a body of the mobile terminal; and switching the first virtual object in the locked-on state to the second virtual object when the shaking operation matches with the second virtual object.

[0008] According to another aspect of the present application, there is provided a virtual object switching device, the device comprising: a display module adapted to display a first virtual object in a locked-on state and a second virtual object not in a locked-on state, the locked-on state indicating that the locked-on virtual object is a target for an action of a master control virtual object; a receiving module for receiving a shake operation, the shake operation being an operation of shaking the device; The virtual object control device further includes a switching module that is used to switch the first virtual object in the locked-on state to the second virtual object when the shake operation matches with the second virtual object.

[0009] According to one aspect of the present application, there is provided a computing device including a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to realize the above-described virtual object switching method.

[0010] According to another aspect of the present application, there is provided a computer-readable storage medium having a computer program stored thereon, the computer program being loaded and executed by a processor to realize the above-described virtual object switching method.

[0011] According to another aspect of the present application, there is provided a computer program product including computer instructions, the computer instructions being stored in a computer-readable storage medium, the processor of the computing device reading the computer instructions from the computer-readable storage medium and the processor executing the computer instructions such that the computing device performs the method of switching virtual objects provided according to the above aspect.

[0012] The beneficial effects brought about by the technical solutions provided by the embodiments of the present application at least include:

[0013] By realizing the switching of virtual objects in a locked-on state by a shake operation, it is possible to avoid switching by touching the lock-on controller multiple times, and it is possible for the user to quickly switch the lock-on target. For example, when the user finds that a fatal weakness has appeared in the second enemy character for a short period of time while the master-controlled virtual character controlled by the user is engaged in a fierce battle with the first enemy character, the second enemy character can be defeated by the master-controlled virtual character attacking the enemy character. Therefore, the user can quickly switch the virtual character (first enemy character) originally locked on by a shake operation to the second enemy character and attack the switched enemy character. Therefore, setting a shake operation for switching the lock-on target not only enhances the user's operation method, but also improves the efficiency of switching the lock-on target of the user, and further improves the game's attackability. [Brief description of the drawings]

[0014] [Figure 1] FIG. 1 shows a block diagram of a computer system according to an exemplary embodiment of the present application. [Diagram 2] 1 shows a flowchart of a method for switching virtual objects provided by an exemplary embodiment of the present application. [Diagram 3] FIG. 2 illustrates a schematic diagram of a first virtual object in a locked-on state and a second virtual object not in a locked-on state provided by an exemplary embodiment of the present application. [Figure 4] FIG. 2 shows a schematic diagram of presentation information of a shake operation provided by an exemplary embodiment of the present application; [Diagram 5] FIG. 1 shows a schematic diagram of shake direction presentation information provided by an exemplary embodiment of the present application; [Figure 6] 4 illustrates a flowchart of a method for switching virtual objects provided by another exemplary embodiment of the present application. [Figure 7] FIG. 2 shows a schematic diagram of shake direction determination provided by an exemplary embodiment of the present application; [Figure 8]4 illustrates a flowchart of a method for switching virtual objects provided by another exemplary embodiment of the present application. [Figure 9] 4 illustrates a flowchart of a method for switching virtual objects provided by another exemplary embodiment of the present application. [Figure 10] 1 illustrates a schematic diagram of a virtual object switching process provided by an exemplary embodiment of the present application; [Figure 11] 4 illustrates a flowchart of a method for switching virtual objects provided by another exemplary embodiment of the present application. [Figure 12] FIG. 2 illustrates a block diagram of a virtual object switching device provided by an exemplary embodiment of the present application; [Figure 13] FIG. 1 shows a block diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0015] 1 is a block diagram of a computer system according to an exemplary embodiment of the present application. The computer system 100 includes a mobile terminal 120 and a server 140.

[0016] The mobile terminal 120 executes an application program supporting a virtual environment. The application program may be any one of a 3D map application, a side-scrolling shooter game, a side-scrolling adventure game, a side-scrolling action game, a side-scrolling strategy game, a virtual reality (VR) application program, and an augmented reality (AR) program. The mobile terminal 120 is a mobile terminal used by a user, and the user acts by using the mobile terminal 120 to operate a master-controlled virtual object located in a 3D virtual environment, and the action includes at least one of adjusting the posture of the body, walking, running, jumping, riding, driving, aiming, picking up, using a throwing item, and attacking other virtual objects, but is not limited to these. Exemplarily, the master-controlled virtual object is a virtual character such as a photorealistic character object or an animated character object. Exemplarily, the user acts by operating the master-controlled virtual character with a UI controller on the virtual environment screen.

[0017] The mobile terminal 120 is connected to the server 140 by a wireless or wired network.

[0018] The server 140 includes at least one of a server, a plurality of servers, a cloud computing platform, and a virtual data center. Exemplarily, the server 140 includes a processor 144 and a memory 142, and the memory 142 includes a receiving module 1421, a control module 1422, and a sending module 1423, where the receiving module 1421 is used to receive requests sent by application programs, such as attacking enemies, the control module 1422 is used to control rendering of a virtual environment screen, and the sending module 1423 is used to send responses to application programs, such as sending damage values ​​of attacks to the application programs. The server 140 is used to provide background services to application programs supporting a 3D virtual environment. Optionally, the server 140 is responsible for the main computation process, and the mobile terminal 120 is responsible for the secondary computation process. Or, the server 140 is responsible for the secondary computation process, and the mobile terminal 120 is responsible for the main computation process.

[0019] Optionally, the application program runs on a different operating system platform (Android or IOS). Optionally, a mobile terminal runs the application program. 120 The device types may be the same or different, and the device types include at least one of a smartphone, a smart watch, a smart TV, an in-vehicle mobile terminal, a wearable device, a tablet PC, an e-book reader, an MP3 player, an MP4 player, and a laptop computer. The following embodiment will be described taking a mobile terminal including a smartphone as an example.

[0020] As can be understood by those skilled in the art, the number of the mobile terminals can be more or less. For example, the mobile terminal can be only one, or the mobile terminals can be dozens or hundreds or more. The embodiments of the present application do not limit the number or device types of the mobile terminals.

[0021] In order to improve the efficiency of switching the lock-on target, Fig. 2 shows a flowchart of a virtual object switching method provided by an exemplary embodiment of the present application, and takes as an example the application of the method to the mobile terminal 120 (or an application program on the mobile terminal 120) shown in Fig. 1. The method includes:

[0022] Step 220: Display a first virtual object in a locked-on state and a second virtual object not in a locked-on state.

[0023] Lock-on state: The lock-on state indicates that the locked-on virtual object is the target of the action of the master-controlled virtual object. The locked-on virtual object may then be attacked by the master-controlled virtual object, such as by hitting, firing, releasing a throwing object, or releasing an attack skill, which is directed toward the locked-on virtual object of the master-controlled virtual object. Alternatively, the master-controlled virtual object may move toward the locked-on virtual object, and the location of the locked-on virtual object may be set as the destination of the master-controlled virtual object. Alternatively, after locking on a virtual object, the master-controlled virtual object may obtain detailed information about the locked-on virtual object, such as displaying a detailed introduction of the locked-on virtual object, "Artillery [grade 5] attack power 80 defense power 50," on the display of the mobile terminal. In this application, the lock-on state only indicates that the locked-on virtual object is the target of the action of the master-controlled virtual object, and this application does not limit the specific action of the master-controlled virtual object against the locked-on virtual object.

[0024] Master-controlled virtual object: refers to a virtual object that the mobile terminal has the authority to control. The master-controlled virtual object can perform at least one of the following actions under the control of the mobile terminal: adjusting the body posture, walking, running, jumping, riding, driving, aiming, picking up, using a throwing item, and attacking other virtual objects. The master-controlled virtual object may be a virtual character object that the user controls in the game, a virtual pet object that the user summons in the game, or a virtual carrier object that the user uses in the game.

[0025] First virtual object: refers to a virtual object having an action capability in a virtual environment, and optionally, the first virtual object is a virtual object controlled by another user, or the first virtual object is an NPC (Non-player Character). The second virtual object also refers to a virtual object having an action capability in a virtual environment, and the first virtual object and the second virtual object are only used to distinguish different virtual objects, that is, the first virtual object may be a virtual object (or NPC) controlled by another user, and the second virtual object may be an NPC (or a virtual object controlled by another user), or both the first virtual object and the second virtual object may be virtual objects controlled by another user, or both the first virtual object and the second virtual object may be an NPC.

[0026] In many games, there may be two types of lock-on modes: active lock-on and passive lock-on. Active lock-on refers to a user independently controlling a master-controlled virtual object to lock onto some virtual object, and passive lock-on refers to locking onto some virtual object based on a preset lock-on rule. For example, when a user independently selects one virtual object from multiple virtual objects in the vicinity and attacks it, this action is called active lock-on. When a master-controlled virtual object controlled by a user is attacked by one of the surrounding virtual objects and then passively targets the virtual object for the next attack, this is called passive lock-on. A user can switch between active lock-on and passive lock-on by performing the corresponding operation.

[0027] In the active lock-on mode, a lock-on indicator or a lock-on visual effect, etc., that is used to present the currently locked-on virtual object to the user is set on the screen of the mobile terminal. In the passive lock-on mode, no special presentation information is set on the screen of the mobile terminal, and the master control virtual object performs a specific action on the locked-on virtual object, allowing the user to directly observe and determine the locked-on virtual object on the screen.

[0028] This application will primarily discuss switching between virtual objects that a user has locked on to in active lock-on mode.

[0029] In one embodiment, a first virtual object in a locked-on state and a second virtual object not in a locked-on state are displayed on a mobile terminal. In general, the first virtual object is indicated to be in a locked-on state on the mobile terminal by at least one of text, a lock-on indicator, and a lock-on visual effect. For example, a square frame (lock-on indicator) is added to the outer periphery of the outline of the first virtual object to indicate that the first virtual object has been successfully locked on, a sight (lock-on indicator) is displayed on the body of the first virtual object to indicate that the first virtual object has been successfully locked on, a blinking effect (lock-on visual effect) is set to be displayed on the first virtual object, a magnifying effect (lock-on visual effect) is set to be displayed on the first virtual object, a color (lock-on visual effect) different from that of the second virtual object is displayed on the first virtual object, and the like.

[0030] 3 shows a schematic diagram of a first virtual object locked on and a second virtual object not locked on, with a lock-on indicator 301 on the first virtual object 31 and no lock-on indicator 301 on the second virtual object 32. The lock-on indicator 301 corresponds to an indication that the first virtual object is in a locked-on state and the second virtual object 32 is not in a locked-on state.

[0031] Step 240: A shake operation is received.

[0032] Here, the shake operation is an operation for shaking the main body of the mobile terminal. In response to a user shaking the main body of the mobile terminal, the mobile terminal receives the shake operation.

[0033] Optionally, the mobile terminal determines that a shake operation has been received based on a signal output from a built-in motion sensor. Generally, the mobile terminal determines that a shake operation has been received based on a change in a signal collected by the motion sensor. The motion sensor may be at least one of an acceleration sensor, a gyro sensor, and a 6-axis sensor (or a 9-axis sensor or a 12-axis sensor) that combines an acceleration sensor and a gyro sensor.

[0034] Optionally, the mobile terminal confirms that the shake operation has been received by a signal received by the antenna. In general, the mobile terminal confirms that the shake operation has been received by a change in amplitude and / or a change in frequency of two consecutive signals received, or confirms that the shake operation has been received by a change in energy of two consecutive signals received. In response to the user shaking the mobile terminal, impedances during propagation of two consecutive signals received by the antenna are made to be mismatched, so that the energies of the two consecutive signals are made to be mismatched. Optionally, the signal received by the antenna may be a wifi signal, a mobile network signal, a Bluetooth signal, etc.

[0035] Optionally, the mobile terminal confirms that the shake operation has been received based on an image captured by the camera. In general, the mobile terminal confirms that the shake operation has been received based on a similarity between two consecutive frames of images captured.

[0036] In one embodiment, before receiving the shake operation, a first form of lock-on controller is further displayed on the display of the mobile terminal, and the first form of lock-on controller is used to present switching of the virtual object in the locked-on state by the shake operation. Schematically, FIG. 4 shows a first form of lock-on controller 401, and a presentation pattern of "Shake the terminal" is displayed on the first form of lock-on controller 401. In one embodiment, in response to displaying the first form of lock-on controller with a preset period on the screen of the mobile terminal as shown in FIG. 4, a third form of lock-on controller is further displayed as shown in FIG. 3, and FIG. 3 shows a third form of lock-on controller 302, and the third form of lock-on controller 302 displays the text "Cancel lock-on".

[0037] Step 260: If the shaking operation matches the second virtual object, the first virtual object in the locked-on state is switched to the second virtual object.

[0038] In one embodiment, the mobile terminal determines a second virtual object matching the shake operation based on the shake direction of the shake operation and the maximum acceleration (shake acceleration) during the shake acquired by the motion sensor, and then displays that the virtual object in the locked-on state has been switched from the first virtual object to the second virtual object.

[0039] Here, the process of displaying that the virtual object in the locked-on state of the mobile terminal has been switched from the first virtual object to the second virtual object may be: the mobile terminal determines a matching second virtual object based on a shaking operation, and then switches the first virtual object in the locked-on state to the second virtual object (the switching of the virtual object is performed by the mobile terminal). Optionally, the mobile terminal determines a matching second virtual object based on a shaking operation, and then reports the second virtual object to a server, and the server performs switching of the lock-on state, and feeds back the switching result to the mobile terminal, and the corresponding mobile terminal displays the second virtual object in the locked-on state and the first virtual object not in the locked-on state based on the switching result.

[0040] In one embodiment, the mobile terminal confirms that a shake operation has been received from the occurrence of a mutation in the waveform of a signal received by the antenna. The mobile terminal determines a shake direction based on a change in the waveform before and after the mutation. The mobile terminal confirms an amplitude of the shake operation based on an energy change value of the signal before and after the mutation. The mobile terminal determines a second virtual object based on the shake direction and the shake amplitude.

[0041] In one embodiment, the mobile terminal determines a shake direction and a swing amplitude of the shake operation based on an image captured by the camera at a start time of the shake operation and an image captured at an end time of the shake operation, and further determines a second virtual object from the shake direction and swing amplitude. The mobile terminal displays that the virtual object in the locked-on state has been switched from the first virtual object to the second virtual object.

[0042] Optionally, a method for indicating that a virtual object on which a mobile terminal is in a locked-on state has been switched from a first virtual object to a second virtual object includes at least one of the following:

[0043] Displaying a lock-on indicator on the second virtual object and canceling the display of the lock-on indicator on the first virtual object.

[0044] Displaying a lock-on visual effect on the second virtual object, and canceling the display of a lock-on visual effect on the first virtual object.

[0045] Displaying presentation information, which is used to indicate the shaking direction of a shaking operation, i.e. displaying presentation information of the shaking direction of a shaking operation of a mobile terminal, and the display manner of the presentation information includes at least one of shapes, arrows, and text.

[0046] 5 shows a screen in which the mobile terminal switches the virtual object in the locked-on state from a first virtual object to a second virtual object. With reference to FIG. 3 as well, it can be seen that the location of the lock-on indicator 301 has transitioned from the first virtual object 31 to the second virtual object 32. FIG. 5 further shows an isosceles triangle 501, the two equal sides of which are longer than the base, and the isosceles triangle 501 is used to indicate the shake direction of the shake operation, which is to the left.

[0047] In summary, by realizing the switching of virtual objects in a locked-on state by a shake operation, it is possible to avoid switching caused by touching the lock-on controller multiple times, and it is possible for the user to quickly switch the lock-on target. For example, when the master-controlled virtual character controlled by the user is engaged in a fierce battle with a first enemy character, if the user finds that a fatal weakness has appeared in the second enemy character for a short period of time, the second enemy character can be defeated by the master-controlled virtual character attacking the enemy character. Therefore, the user can switch the virtual character (first enemy character) that was originally locked on by a shake operation to the second enemy character and attack the switched enemy character. Therefore, setting the lock-on target to be switched by a shake operation not only enhances the user's operation method, but also improves the efficiency of switching the lock-on target of the user, and further improves the game's attackability.

[0048] In order to improve the efficiency of switching the lock-on target, Fig. 6 shows a flowchart of a virtual object switching method provided by an exemplary embodiment of the present application, which is illustrated by taking an example of application of the method in the mobile terminal 120 shown in Fig. 2. The method includes the following steps:

[0049] Step 620: Display a first virtual object in a locked-on state and a second virtual object not in a locked-on state.

[0050] Here, the locked-on state indicates that the locked-on virtual object is a target of an action of a master-control virtual object, which is a virtual object over which the mobile terminal has control. In one embodiment, a first virtual object in the locked-on state and a second virtual object not in the locked-on state are displayed on the mobile terminal. Optionally, the first virtual object in the locked-on state is indicated on the mobile terminal by at least one of the following methods: text, a lock-on indicator, and a lock-on visual effect.

[0051] Step 640: The shake direction and shake acceleration of the shake operation are obtained by the motion sensor.

[0052] Here, the shake operation refers to an operation of shaking the main body of the mobile terminal.

[0053] Since the shake operation may be one shake operation or multiple shake operations, and one shake operation corresponds to one shake direction, and there may be multiple shake directions during multiple shake operations, the shake direction of the entire shake operation process can be determined based on the start position and end position of the mobile terminal to avoid different shake directions during the shake operation from affecting the final result. Corresponding to one embodiment, the mobile terminal obtains a first position located at the start time of the shake operation of the mobile terminal by a motion sensor, and then obtains a second position located at the end time of the shake operation of the mobile terminal by the motion sensor. Based on the first position and the second position, the shake direction of the shake operation performed on the mobile terminal is determined.

[0054] In general, the mobile terminal acquires the coordinates (x1, y1, z1) of a first position located at the start time of a shake operation by a gyro sensor, acquires the coordinates (x2, y2, z2) of a second position located at the end time of the shake operation by the gyro sensor, and can determine the shake direction by calculating the coordinate vector. For example, when the coordinates of the first position are (2, 0, 0) and the coordinates of the second position are (1, 0, 0), the shake direction is left.

[0055] Optionally, the mobile terminal may also determine the shake direction based on an acceleration sensor, or a 6-axis sensor (or a 9-axis sensor, or a 12-axis sensor) that combines an acceleration sensor and a gyro sensor.

[0056] In summary, FIG. 7(a) shows that when a single shaking operation is performed, the mobile terminal determines the shake direction based on the final position and the starting position, and FIG. 7(b) shows that when multiple shaking operations are performed, the mobile terminal determines the shake direction based on the final position and the starting position.

[0057] In order to determine the shaking direction of the mobile terminal, it is necessary to determine the start time and end time of the shaking operation performed on the mobile terminal, but since the acceleration of the mobile terminal inevitably increases when performing a shaking operation, the start time and end time can be determined from the magnitude relationship of the acceleration data collected by the motion sensor. Corresponding to one embodiment, the mobile terminal acquires acceleration by the motion sensor, and when the acceleration increases from 0 and becomes larger than a first threshold, it indicates that the mobile terminal has been shaken, and the time when the acceleration acquired by the motion sensor of the corresponding mobile terminal becomes larger than the first threshold is determined as the start time of the shaking operation, and thereafter, the mobile terminal continues to acquire acceleration by the motion sensor, and when the mobile terminal determines that the acceleration has decreased and is still smaller than the second threshold, it indicates that the mobile terminal has stopped being shaken, and the time when the period during which the acceleration acquired by the motion sensor of the corresponding mobile terminal is smaller than the second threshold reaches the period threshold is determined as the end time of the shaking operation.

[0058] Optionally, the first threshold and the second threshold may be the same, for example, the first threshold and the second threshold are 0 m / s 2 The first threshold and the second threshold may be different. For example, the first threshold may be 0 m / s 2 and the second threshold is 0.2m / s 2 Alternatively, the maximum acceleration during the shaking operation may be determined as the shake acceleration by default, since the acceleration data during the shaking operation is not completely the same and only one locked-on virtual object needs to be determined thereafter. According to one possible embodiment, after the mobile terminal determines the start time and end time of the shaking operation, the maximum value of the acceleration between the start time and the end time may be determined as the shake acceleration of the shaking operation.

[0059] In general, a mobile terminal acquires acceleration using an acceleration sensor or a 6-axis sensor (or a 9-axis sensor, or a 12-axis sensor) that combines an acceleration sensor and a gyro sensor.

[0060] Based on the above, the mobile terminal obtains the shake direction and shake acceleration of the shake operation.

[0061] Step 660: A second virtual object is determined based on the shake direction and the shake acceleration, and the first virtual object in the locked-on state is switched to the second virtual object.

[0062] In the process of determining the second virtual object based on the shake direction and the shake acceleration, a reference object is often required, for example, if the shake direction is left, the second virtual object is on the left side of the reference object. Based on the switching scene of this embodiment, the user is trying to switch the first virtual object in the locked-on state to another virtual object, so if the shake direction is left, it represents that the virtual object to be switched should be on the left side of the first virtual object. Therefore, in one embodiment, the mobile terminal determines the first object number of the candidate virtual objects in the shake direction of the first virtual object by taking the first virtual object as a reference position in the virtual environment. The first object number can be represented by n, and the value of n can be a positive integer.

[0063] Optionally, there may be one or more candidate virtual objects in the shake direction of the first virtual object, i.e., the value of n may be 1 or 3. When the number of first objects is equal to 1 (i.e., when the value of n is equal to 1), the candidate virtual object represents a second virtual object to be switched, and the mobile terminal can directly determine the candidate virtual object in the shake direction as the second virtual object. Optionally, when the number of first objects is greater than 1 (i.e., when the value of n is greater than 1), the second virtual object to be switched cannot be determined based only on the shake direction, and the second virtual object needs to be further selected from the multiple candidate virtual objects based on the shake acceleration. The corresponding mobile terminal determines the second virtual object from the n candidate virtual objects in the shake direction based on the maximum value of the acceleration during the shake (shake acceleration).

[0064] In one embodiment, when the number of first objects is greater than 1 (i.e., when the value of n is greater than 1), the mobile terminal can set n acceleration sections in the shake direction, and different acceleration sections correspond to the locations of different candidate virtual objects, and therefore, when there are n candidate virtual objects, n acceleration sections are set correspondingly. Furthermore, based on the i-th acceleration section including the shake acceleration, the candidate virtual object corresponding to the i-th acceleration section is determined as the second virtual object. That is, when the maximum value of the shake acceleration during the shake is in the i-th acceleration section, the mobile terminal determines the i-th candidate virtual object of the n virtual objects as the second virtual object. Here, the n candidate virtual objects and the n acceleration sections correspond one-to-one, and the n candidate virtual objects are arranged in order of the distance from the first virtual object to the closest to the furthest, and the n acceleration sections are arranged in order of the acceleration value from the smallest to the largest. Here, n and i are positive integers.

[0065] In general, if the shake direction acquired by the motion sensor is left, there are two candidate virtual objects to the left of the first virtual object, the mobile terminal sets two acceleration intervals corresponding to the left side as (0, 3) and (3, +∞) respectively, and the maximum value of the shake acceleration of the shake operation acquired based on the motion sensor is 2, the first virtual object to the left of the first virtual object is determined to be the second virtual object.

[0066] In another embodiment, when the number of first objects is greater than 1 (i.e., the value of n is greater than 1), the mobile terminal obtains k acceleration sections set in advance, where k is greater than n. Then, a jth acceleration section including the shake acceleration is determined, and when the maximum value of the shake acceleration during shaking is in the jth acceleration section and j is not greater than n, the jth candidate virtual object among the n candidate virtual objects is determined as the second virtual object. When the maximum value of the shake acceleration is in the jth acceleration section (the shake acceleration is in the jth acceleration section) and j is greater than n, the nth candidate virtual object among the n candidate virtual objects is determined as the second virtual object. Here, the n candidate virtual objects are arranged in order of the distance from the first virtual object to the closest to the furthest, and the k acceleration sections are arranged in order of the acceleration value from the smallest to the largest. Here, k and j are positive integers.

[0067] In general, when the value of n is 3, the mobile terminal obtains eight preset acceleration sections in the order of (0,3), (3,6), (6,9), (9,12), (12,15), (15,18), (18,21), and (21,+∞). If the maximum value of the shake acceleration during shaking is 5 (falling into the second acceleration section), the second candidate virtual object on the left side of the first virtual object is determined as the second virtual object. If the maximum value of the shake acceleration during shaking is 14 (falling into the fifth acceleration section), the third candidate virtual object on the left side of the first virtual object is determined as the second virtual object.

[0068] It should be noted that the k acceleration intervals may be obtained based on pre-settings of a server supporting the execution of an application program, or may be obtained based on settings made by a user on the application program; for example, when a user adjusts the sensitivity of a shake operation on an application program, the range of acceleration intervals and / or the number of acceleration intervals are adjusted.

[0069] In this way, the second virtual object is determined in the virtual environment. The mobile terminal then displays that the locked-on virtual object has been switched from the first virtual object to the second virtual object, and possible display methods have already been described in detail in step 260 above, so will not be described further here.

[0070] In summary, receiving the shake direction and shake acceleration of a shake operation by a motion sensor, determining a second virtual object based on the shake direction and shake acceleration, and finally switching the locked-on virtual object from the first virtual object to the second virtual object provides a specific implementation method for lock-on target switching based on a shake operation and ensures high efficiency of lock-on target switching.

[0071] In order to improve the efficiency of lock-on target switching, FIG. 8 shows a flowchart of a virtual object switching method provided in one of the schematic embodiments of the present application, which is illustrated in an example applied to the mobile terminal 120 shown in FIG. 2, and includes the following steps:

[0072] Step 820: Display a first virtual object in a locked-on state and a second virtual object not in a locked-on state.

[0073] wherein the locked-on state indicates that the locked-on virtual object is a target of an action of a master control virtual object, the master control virtual object being a virtual object over which the mobile terminal has control. In one embodiment, a first virtual object in the locked-on state and a second virtual object not in the locked-on state are displayed on the mobile terminal. Optionally, the mobile terminal indicates that the first virtual object is in the locked-on state in at least one of the following ways: text, a lock-on indicator, and a lock-on visual effect.

[0074] Step 840: The shake direction and the shake amplitude of the shake operation are determined based on the image captured by the camera.

[0075] In one embodiment, the mobile terminal acquires, through a camera, a first image captured by the camera at a start time of a shaking operation and a second image captured by the camera at an end time of the shaking operation, and then performs feature point matching based on the first image and the second image to determine a shaking direction of the shaking operation.

[0076] In one embodiment, the mobile terminal performs feature point tracking on an image captured by a camera to determine a shake direction of a shake operation. The feature point tracking may adopt a tracking algorithm based on visual odometry, and the present application is not limited thereto. Optionally, the feature point tracking adopts a tracking algorithm using optical flow called KLT (Kanade-Lucas). Optionally, the feature point tracking adopts an ORB feature descriptor extracted based on an ORB (Oriented FAST and Rotated BRIEF) algorithm to perform feature point tracking. The present application is not limited to a specific algorithm for tracking feature points.

[0077] In one embodiment, the mobile terminal captures images by a camera and obtains a similarity between two consecutive frames of images, and if the similarity between the two consecutive frames of images is large, it indicates that a shaking operation has not occurred on the mobile terminal, and conversely, if the similarity between the images of the two consecutive frames is small, it indicates that a shaking operation has occurred on the mobile terminal. If the similarity between the first two consecutive frames of images captured by the corresponding mobile terminal by the camera is smaller than a third threshold, it indicates that a shaking operation has started, and the previous frame of the first two consecutive frames of images is determined as a first image, and the time when the first image is captured is determined as the start time of the shaking operation.

[0078] In summary, the mobile terminal acquires an image by a camera, and then calculates the similarity between two consecutive frame images. The similarity between the two consecutive frame images can be calculated based on feature points, and if the amount of feature points that appear overlapping between the two consecutive frame images is smaller than a first quantity threshold, the similarity between the two consecutive frame images is deemed to be smaller than a third threshold, and in this case, the previous frame of the two consecutive frame images is determined as the first image. Optionally, a similarity determination model is set, and the two consecutive frame images are input into the similarity determination model to output the similarity between the two consecutive frame images, and the relationship between the similarity and the third threshold is compared, and if the similarity is smaller than the third threshold, the previous frame of the two consecutive frame images can be determined as the first image, and the capture time of the first image can be determined as the start time of the shake operation.

[0079] In order to avoid a calculation error of the similarity leading to an erroneous determination of the start time, optionally, after the mobile terminal captures an image by the camera, if it determines that the similarity between the images of two consecutive frames is smaller than a third threshold, the counter is incremented by 1, if the mobile terminal determines within a first preset period that the similarity between another two consecutive frames of images is also smaller than the third threshold, the counter is incremented by 1 again, and if the value accumulated in the counter reaches a preset value within a second preset period, it is determined that a shake operation has been detected, and the previous frame of the two consecutive frames of images that first reached the third threshold is determined as the first image.

[0080] In one embodiment, when the mobile terminal determines that the similarity between the images of the two consecutive frames is small, it indicates that the mobile terminal is no longer shaking, and when the similarity between the images of the second consecutive two frames captured by the corresponding mobile terminal by the camera is greater than a fourth threshold, the later flume of the images of the second consecutive two frames is determined as the second image, and the acquisition time of the second image is determined as the end time of the shaking operation. The acquisition time of the second image is also the capture time of the second image.

[0081] In general, the mobile terminal acquires an image by a camera, and then calculates the similarity between two consecutive frame images. Optionally, if the amount of feature points that appear overlapping between the two consecutive frame images is greater than a second quantity threshold, the similarity between the two consecutive frame images is deemed to be greater than a fourth threshold, and the latter frame of the two consecutive frame images is determined as the second image. Optionally, the two consecutive frame images are input into a similarity determination model to output the similarity between the two consecutive frame images, and the relationship between the similarity and the fourth threshold is compared, and if the similarity is greater than the fourth threshold, the latter frame of the two consecutive frame images is determined as the second image, and the capture time of the second image is determined as the end time of the shake operation.

[0082] Optionally, after the mobile terminal acquires an image by the camera, if the mobile terminal determines that the similarity between two consecutive frames of images is greater than a fourth threshold, it increments the counter by 1, and if the mobile terminal determines within a third preset period that the similarity between another two consecutive frames of images is also greater than the fourth threshold, it increments the counter by 1 again, and if the value accumulated by the counter reaches a second preset value within a fourth preset period, it determines that the cessation of shaking has been detected, and determines the subsequent frame of the two consecutive frames of images that caused the counter to reach the second preset value as the second image.

[0083] As a result of the above, it is possible to determine that the first image and the second image have been obtained, and further to determine the shake direction and the shake amplitude of the shake operation.

[0084] Optionally, the mobile terminal can determine a shake direction of the shake operation from a displacement direction of matching feature points in the first image and the second image. Optionally, a shake amplitude value of the shake operation can be obtained by mapping based on a similarity between the first image and the second image.

[0085] Optionally, a correspondence relationship between the similarity and the amplitude of the shake can be preset in the mobile terminal, where the smaller the similarity, the larger the amplitude of the shake, and the amplitude of the shake shows a negative correlation with the similarity. After the mobile terminal determines the similarity between the first image and the second image, it can determine the amplitude of the shake corresponding to the shake operation at that time from the correspondence relationship between the similarity and the amplitude of the shake.

[0086] Step 860: A second virtual object is determined based on the shake direction and the shake amplitude, and the first virtual object in the locked-on state is switched to the second virtual object.

[0087] Similarly to the case where the second virtual object is determined based on the shake direction and the shake acceleration in the above embodiment, the first virtual object must be set as the reference position when the second virtual object is determined based on the shake direction and the shake amplitude. When the first virtual object is set as the reference position in the virtual environment, the mobile terminal determines the second object number of the candidate virtual objects in the shake direction with the first virtual object as the reference position, and the second object number can be represented by m, where m is a positive integer. When the second object number is equal to 1 (i.e., when the value of m is equal to 1), the mobile terminal can directly determine one candidate virtual object existing in the shake direction as the second virtual object. When the second object number is greater than 1 (i.e., when the value of m is greater than 1), it is necessary to further select the second virtual object from the multiple candidate virtual objects. Correspondingly, based on the amplitude of the shake during shaking, the mobile terminal can determine the second virtual object from m candidate virtual objects existing in the shake direction.

[0088] Optionally, when the number of second objects is greater than 1 (when the value of m is greater than 1), the mobile terminal sets m swing range sections corresponding to the shake direction. When the swing range of the shake is within the pth swing range section, the mobile terminal determines the pth virtual object from among the m virtual objects as the second virtual object. Here, the m candidate virtual objects and the m swing range sections correspond one-to-one, the m candidate virtual objects are arranged in order of distance from the first virtual object to the closest to the furthest, and the m swing range sections are arranged in order of swing range value from smallest to largest.

[0089] In general, when the shake direction is to the left and there are two candidate virtual objects to the left of the first virtual object, the mobile terminal sets two corresponding swing range intervals on the left side as (0, 3) and (3, +∞), respectively, and when the maximum shake swing range obtained based on the similarity is 2, it determines the first candidate virtual object to the left of the first virtual object as the second virtual object.

[0090] Optionally, when the number of second objects is greater than 1 (when the value of m is greater than 1), the mobile terminal obtains R swing range sections set in advance, where R is greater than m. Then, when the swing range of the shake is in the r swing range section and r is not greater than m, the mobile terminal determines the r-th candidate virtual object among the m candidate virtual objects as the second virtual object. When the swing range of the shake is in the r-th swing range section and r is greater than m, the mobile terminal determines the m-th candidate virtual object among the m candidate virtual objects as the second virtual object. Here, the m candidate virtual objects are arranged in order of the distance from the first virtual object to the closest to the furthest, and the R swing range sections are arranged in order of the swing range value from the smallest to the largest.

[0091] Here, m, p, R and r are all positive integers.

[0092] In summary, when the value of m is 3, the mobile terminal obtains eight preset swing range intervals, which are (0,3), (3,6), (6,9), (9,12), (12,15), (15,18), (18,21), and (21,+∞), in that order. When the swing range during shaking is 5 (falling into the second swing range interval), the second candidate virtual object on the left side of the first virtual object is determined as the second virtual object. When the swing range during shaking is 14 (falling into the fifth acceleration range), the third candidate virtual object on the left side of the first virtual object is determined as the second virtual object.

[0093] From the above, the mobile terminal determines a second virtual object in the virtual environment, and then the mobile terminal displays that the locked-on virtual object has been switched from the first virtual object to the second virtual object, and possible display methods have already been described in detail in step 260 above, so will not be described further here.

[0094] In summary, confirming that a shake operation has been received by a camera built into the mobile terminal, determining the shake direction and shake amplitude of the shake operation based on the image captured by the camera, determining a second virtual object from the shake direction and shake amplitude, and finally switching the locked-on virtual object from the first virtual object to the second virtual object provides a specific method for realizing lock-on target switching based on a shake operation and ensures high efficiency of lock-on target switching.

[0095] In order to improve the efficiency of lock-on target switching, FIG. 9 is a flowchart of a virtual object switching method provided in one of the schematic embodiments of the present application, and the method is described in an example applied to the mobile terminal 120 shown in FIG. 1, including:

[0096] Step 910: The second form of the lock-on controller is displayed.

[0097] A second type of lock-on controller is displayed on the screen of the mobile terminal. The second type of lock-on controller is used by the master control virtual object to lock on to a virtual object from among the candidate virtual objects. Also referring to FIG. 10(a), FIG. 10(a) shows the second type of lock-on controller 1001, which is generally located in the lower right corner area of ​​the screen of the mobile terminal, allowing the user to quickly perform a lock-on operation.

[0098] Step 920: Display at least two virtual objects.

[0099] Here, at least two of the virtual objects include a first virtual object that is not in a locked-on state. Also refer to Fig. 10(a), which now shows five virtual objects.

[0100] Step 930: In response to a first trigger operation on the second type lock-on controller, it is determined to perform a lock-on operation.

[0101] Optionally, the first trigger operation includes at least one of a long press trigger, a single press trigger, a double press trigger, a drag trigger, and a pressure trigger. Generally, in response to the lock-on controller 1001 of the second form in Fig. 10(a) receiving the first trigger operation, the mobile terminal determines to perform a lock-on operation.

[0102] Step 940: If the first virtual object satisfies the lock-on condition, display the first virtual object in a locked-on state.

[0103] In one embodiment, when the first virtual object satisfies the lock-on condition, displaying the first virtual object in a locked-on state includes at least one of the following methods:

[0104] In the virtual environment, a virtual object having a smallest distance from a master control virtual object among at least two virtual objects is determined as a first virtual object, and the first virtual object in a locked-on state is displayed.

[0105] Optionally, the mobile terminal obtains a distance between each virtual object and the master control virtual object, determines a virtual object with the smallest distance as a first virtual object, performs a lock-on operation on the first virtual object, and correspondingly displays the first virtual object in a locked-on state.

[0106] In the virtual environment, from among at least two virtual objects, a virtual object whose distance from a master control virtual object is smaller than a threshold and which is oriented in the direction of the master control virtual object is determined as a first virtual object, and the first virtual object in a locked-on state is displayed.

[0107] Optionally, the mobile terminal obtains a distance between each virtual object and the master control virtual object, further compares each distance with a distance threshold, selects from among them a virtual object whose distance is smaller than the distance threshold, then selects from among them a virtual object in the orientation of the master control virtual object as a first virtual object, performs a lock-on operation on it, and displays the first virtual object in the locked-on state.

[0108] In the virtual environment, among at least two virtual objects, a virtual object whose distance from a master control virtual object is smaller than a distance threshold and whose absolute life value is the smallest is determined as a first virtual object, and the first virtual object in a locked-on state is displayed, the life value is used to measure the wear degree of the virtual object in the virtual environment, and the absolute life value is the remaining life value of the virtual object.

[0109] Optionally, the mobile terminal obtains a distance between each virtual object and the master control virtual object, and compares each distance with a distance threshold, first selecting a virtual object whose distance is smaller than the distance threshold, then obtaining an absolute life value of each virtual object, and determining the virtual object with the smallest absolute life value as a first virtual object, thereby performing a lock-on operation on the first virtual object.

[0110] In the virtual environment, among at least two virtual objects, a virtual object whose distance from a master control virtual object is smaller than a distance threshold and whose relative life value is the smallest is determined as a first virtual object, and the first virtual object in a locked-on state is displayed, and the relative life value is a ratio between the remaining life value and the full life value of the virtual object.

[0111] Optionally, the mobile terminal obtains a distance between each virtual object and the master control virtual object, and further compares each distance with a distance threshold, and first selects virtual objects whose distance is smaller than the distance threshold from among them, and then selects relative life values ​​of each virtual object, and determines the virtual object with the smallest relative life value as a first virtual object, thereby performing a lock-on operation on the first virtual object.

[0112] The relative life value may be a ratio between the absolute life value and the full life value, where the absolute life value is the remaining life value of the virtual object.

[0113] Referring also to FIG. 10, when the first virtual object satisfies the lock-on condition, the display screen of the mobile terminal switches from FIG. 10(a) to FIG. 10(b), the first virtual object 31 is in a locked-on state, and the first virtual object 31 A lock-on indicator 301 is displayed on top.

[0114] STEP 950: Display a first form of the lock-on controller.

[0115] When the mobile terminal receives a first trigger operation to the second-type lock-on controller 1001, the mobile terminal locks on to the first virtual object 31 from among the at least two virtual objects, and the display screen of the mobile terminal switches from Fig. 10(a) to Fig. 10(b). Referring also to Fig. 10(b), the first-type lock-on controller 401 presents to the user that the virtual object in the locked-on state can be switched by a shake operation. Fig. 10(b) further shows the first virtual object 31, the second virtual object 32, and the lock-on indicator 301.

[0116] STEP 960: Display the third type of lock-on controller.

[0117] After the display of the lock-on controller in the first mode is completed within a preset period, a lock-on controller in a third mode is displayed on the screen of the mobile terminal. The lock-on controller in the third mode is used to cancel the lock-on of the first virtual object.

[0118] Schematically, FIG. 10(c) shows a third embodiment of the lock-on controller 302.

[0119] If the mobile terminal receives a second trigger operation for the third mode lock-on controller 302, the mobile terminal executes a lock-on cancel operation, and the mobile terminal stops executing the virtual object switching method. If the mobile terminal does not receive a second trigger operation by the third mode lock-on controller 302, executes step 970 below.

[0120] Optionally, the second trigger operation includes at least one of a long press trigger, a single press trigger, a double press trigger, a drag trigger and a pressure trigger.

[0121] Step 970: Display a first virtual object in a locked-on state and a second virtual object not in a locked-on state.

[0122] In one embodiment, the mobile terminal displays a first virtual object in a locked-on state and a second virtual object in a non-locked-on state, optionally the second virtual object belonging to one of the at least two virtual objects of step 920 above.

[0123] 10(c) shows a first virtual object 31 in a locked-on state and a second virtual object 32 not in a locked-on state, where the second virtual object belongs to one of the at least two virtual objects of step 920 above.

[0124] STEP 980: A shake operation is received.

[0125] Here, the shake operation refers to an operation of shaking the main body of the mobile terminal.

[0126] Optionally, the mobile terminal receives the shake operation via a built-in motion sensor, which includes an acceleration sensor, a gyro sensor, and a 6-axis sensor (or a 9-axis sensor, or a 12-axis sensor) that combines the acceleration sensor and the gyro sensor.

[0127] Optionally, the mobile terminal confirms that the shake operation is received based on an image captured by the camera. In general, the mobile terminal confirms that the shake operation is received based on a similarity between two consecutive frames of images captured.

[0128] Optionally, the mobile terminal confirms that a shake operation has been received from a signal received by the antenna. Generally, the mobile terminal confirms that a shake operation has been received from an energy change value of two consecutive received signals.

[0129] Optionally, the mobile terminal can receive the shake operation using other sensors, for example, an optical sensor can confirm that the shake operation has been received based on the change in light intensity caused by the shake operation, a temperature sensor, a magnetic field sensor, etc.

[0130] Step 990: If the shake operation matches the second virtual object, the first virtual object in the locked-on state is switched to the second virtual object.

[0131] In one embodiment, the mobile terminal determines a second virtual object that matches the shake operation from the shake direction of the shake operation and the maximum acceleration during the shake acquired by the motion sensor, and then displays that the virtual object in the locked-on state has been switched from the first virtual object to the second virtual object.

[0132] In one embodiment, the mobile terminal confirms receipt of a shake operation from a mutation occurring in the waveform of a signal received by the antenna. The shake direction is determined from a change in the waveform after the mutation and before the mutation. The shake amplitude of the shake operation is confirmed from an energy change value of the signal before and after the waveform mutation. The mobile terminal determines a second virtual object from the shake direction and the shake amplitude. The mobile terminal then displays that the virtual object in the locked-on state has been switched from the first virtual object to the second virtual object.

[0133] In one embodiment, the mobile terminal determines a shake direction and a shake amplitude of the shake operation from an image captured by the camera at a start time of the shake operation and an image captured at an end time of the shake operation, and further determines a second virtual object from the shake direction and the shake amplitude. Thereafter, the mobile terminal displays that the virtual object in the locked-on state has been switched from the first virtual object to the second virtual object.

[0134] 10(d) shows the second virtual object 32 in a locked-on state, the lock-on state is switched from the first virtual object 31 to the second virtual object 32, and no lock-on indicator is displayed on the first virtual object 31. Note that FIG. 10(d) also shows a shake direction presentation graphic 501.

[0135] In addition, in the process of executing steps 970 to 990, or after executing step 990, the mobile terminal may execute a lock-on cancel operation in response to the lock-on controller of the third embodiment receiving the second trigger operation. When the lock-on cancel operation is executed, the mobile terminal stops switching the lock-on target.

[0136] In summary, by setting a first form lock-on controller (shake operation presentation information), a second form lock-on controller (capable of executing a lock-on operation), and a third form lock-on controller (capable of executing a lock-on cancel operation) on the screen of a mobile terminal, and setting presentation information for the shake direction, a concrete method for realizing a method of switching virtual objects can be achieved, and the switching method can be made to be closer to the user's operating habits.

[0137] In order to improve the efficiency of lock-on target switching, FIG. 11 shows a flowchart of a virtual object switching method provided in one of the schematic embodiments of the present application, and illustrates an example of the method applied to a smartphone, including:

[0138] Step 1101: Start.

[0139] The mobile phone starts executing a lock-on target switching flow.

[0140] Step 1102: It is determined whether the user has tapped the target lock-on button on the main screen.

[0141] The mobile phone determines whether the user has tapped a target lock-on button on the main screen. The target lock-on button is a button used to independently lock on to a target character on the main screen. When the mobile phone executes an application program, the target lock-on button is set in the lower right corner area of ​​the mobile phone display. Normally, if there is no lockable target within a certain distance range from the player character, the user's trigger operation of the target lock-on button has no effect. If there is a lockable target within a certain distance range from the player character, the user's trigger operation of the target lock-on button activates a lock-on.

[0142] If the user taps the target lock-on button on the main screen, execute step 1104. If the user does not tap the target lock-on button on the main screen, execute step 1103.

[0143] Step 1103: The target lock-on switching is not executed.

[0144] If the mobile phone does not receive a trigger operation of the target lock-on button, the mobile phone does not perform target lock-on switching. Optionally, the trigger operation includes a long press trigger, a single press trigger, a double press trigger, a drag trigger, a pressure trigger, etc.

[0145] Step 1104: It is determined whether there is a target within the field of view that can be locked on.

[0146] When the mobile phone receives a trigger operation on the target lock-on button by the user, the mobile phone judges whether there is a lock-on target within the field of view of the player character. If there is a lock-on target, step 1106 is executed. If there is no lock-on target, step 1105 is executed.

[0147] Step 1105: Target lock-on is not performed.

[0148] If the mobile phone determines that there is no lockable target within the field of view of the player character, the mobile phone does not perform target lock-on, i.e., the mobile phone does not lock onto a virtual object within the field of view of the player character.

[0149] Step 1106: The number of targets matching the current lock-on state is greater than one.

[0150] The mobile phone determines whether the number of targets matching the lock-on state within the player character's field of view is greater than 1. If the number of targets matching the lock-on state is greater than 1, the mobile phone starts a thread that switches the lock-on target in response to a shake operation, i.e., the mobile phone then executes step 1108. If the number of targets matching the lock-on state is equal to 1, the mobile phone determines that the lock-on target cannot currently be switched, i.e., the mobile phone does not start a thread that switches the lock-on target in response to a shake operation, i.e., the mobile phone then executes step 1107.

[0151] Step 1107: The acceleration sensor is not activated.

[0152] The mobile phone does not activate the acceleration sensor.

[0153] Step 1108: The acceleration sensor is activated.

[0154] Based on the current situation where the number of targets matching the lock-on state is greater than 1, the mobile phone activates the acceleration sensor, which can be used to determine the shake direction and shake acceleration of the subsequent shake operation.

[0155] Step 1109: Is a shaking operation occurring on the mobile phone?

[0156] The mobile phone judges whether or not a shake operation has been received, and if so, judges the direction of the shake operation. If not, step 1110 is executed.

[0157] Step 1110: Do not execute target lock-on.

[0158] If the mobile phone confirms that it has not received a shake operation, it does not execute target lock-on.

[0159] Step 1111: The position after shaking is higher than the position before shaking.

[0160] After the mobile phone confirms that a shake operation has occurred, the mobile phone confirms that the position after the shake is higher (the shake direction is higher) than the position before the shake.

[0161] Step 1112: The position after shaking is to the left compared to the position before shaking.

[0162] After the mobile phone confirms that a shake operation has occurred, the mobile phone confirms that the position after the shake is to the left (the shake direction is left) compared to the position before the shake.

[0163] Step 1113: The position after shaking is to the right compared to the position before shaking.

[0164] After the mobile phone confirms that a shake operation has occurred, the mobile phone confirms that the position after the shake is to the right (the shake direction is right) compared to the position before the shake.

[0165] Step 1114: The position after shaking is lower than the position before shaking.

[0166] After the mobile phone confirms that a shake operation has occurred, the mobile phone confirms that the position after the shake is lower (the shake direction is lower) than the position before the shake.

[0167] Step 1115: The shake acceleration value of the mobile phone is acquired.

[0168] The mobile phone obtains a shake acceleration value. Optionally, the mobile phone obtains a maximum value of shake acceleration during shaking by an acceleration sensor.

[0169] Step 1116: The dynamic section of acceleration in which the shaking acceleration is included is determined.

[0170] The mobile phone determines an acceleration dynamic section including the shake acceleration, and determines a lock-on target after switching according to the acceleration dynamic section. Optionally, the mobile phone determines an acceleration dynamic section matching the maximum value of the shake acceleration according to a maximum value of the shake acceleration during shaking. Optionally, the mobile phone may set a certain number of acceleration dynamic sections in advance, or the mobile phone can set the same number of acceleration dynamic sections according to the number of virtual objects existing in the shake direction of the player character in the virtual environment.

[0171] Step 1117: Switch the lock-on target to the back.

[0172] If the position after shaking is higher than the position before shaking, the mobile phone controls the lock-on target to switch to the back side.

[0173] Step 1118: Switch lock-on target to left.

[0174] If the position after shaking is to the left compared to the position before shaking, the mobile phone controls the lock-on target to switch to the left.

[0175] Step 1119: Switch lock-on target to the right.

[0176] If the position after shaking is to the right compared to the position before shaking, the mobile phone controls the lock-on target to switch to the right.

[0177] Step 1120: Switch the lock-on target to the front.

[0178] If the position after shaking is lower than the position before shaking, the mobile phone controls the lock-on target to be switched forward.

[0179] Step 1121: Did the user tap the cancel lock-on button?

[0180] The mobile phone determines whether the user taps a cancel lock-on button, and if the user taps the cancel lock-on button, the mobile phone stops switching virtual objects, turns off the lock-on logic of the application program, and ends the lock-on process.

[0181] If the user taps the cancel lock-on button, step 1122 is executed.

[0182] Step 1122: The acceleration sensor is turned off.

[0183] The mobile phone will finish the lock-on process and turn off the acceleration sensor.

[0184] FIG. 12 is a block diagram of a virtual object switching device provided by an exemplary embodiment of the present application, the device comprising: a display module 1201 used to display a first virtual object in a locked-on state and a second virtual object not in a locked-on state, the locked-on state indicating that the locked-on virtual object is a target of an action of a master control virtual object; A receiving module 1202 used for receiving a shake operation, the shake operation being an operation of shaking a body of a mobile terminal; The control unit 120 further includes a switching module 1203 used to switch the first virtual object in the locked-on state to the second virtual object when the shake operation matches with the second virtual object.

[0185] In one optional embodiment, the display module 1201 is further used for displaying a lock-on indicator on the second virtual object and canceling displaying the lock-on indicator on the first virtual object.

[0186] In one optional embodiment, the display module 1201 is further used for displaying a lock-on visual effect on the second virtual object and canceling displaying the lock-on visual effect on the first virtual object.

[0187] In one optional embodiment, the display module 1201 is further used to display presentation information, the presentation information is used to indicate the shake direction of the shake operation, and the display manner of the presentation information includes at least one of a figure, an arrow, and a text.

[0188] In one optional embodiment, the receiving module 1202 is further used for obtaining a shake direction and a shake acceleration of the shake operation by a motion sensor, where the shake acceleration is the maximum acceleration during the shake operation.

[0189] In one optional embodiment, the switching module 1203 is further used for determining a second virtual object based on the shake direction and the shake acceleration, and switching the first virtual object in the locked-on state to the second virtual object.

[0190] In one optional embodiment, the switching module 1203 further comprises: determining a first object number of candidate virtual objects in a shake direction when a first virtual object is set as a reference position in the virtual environment; If the number of first objects is equal to 1, determining a candidate virtual object on the shake direction as a second virtual object; When the first object number is greater than one, it is used to determine a second virtual object from among the candidate virtual objects in the shake direction based on the shake acceleration.

[0191] In one optional embodiment, the switching module 1203 further comprises: If the number of first objects is greater than 1, set n acceleration sections in the shake direction, and different acceleration sections correspond to different positions of the candidate virtual objects; The candidate virtual object in the i-th acceleration section is used to determine the candidate virtual object in the i-th acceleration section as the second virtual object based on the i-th acceleration section that includes the shake acceleration.

[0192] Here, i is a positive integer, the candidate virtual objects are arranged in order of the distance from the first virtual object to the closest to the furthest, and the n acceleration sections are arranged in order of the acceleration values ​​from smallest to largest.

[0193] In one optional embodiment, the switching module 1203 further comprises: When the number of first objects is greater than 1, a preset k number of acceleration sections are obtained, where k is greater than the number of first objects; determining the j-th candidate virtual object of the candidate virtual objects as a second virtual object when the shake acceleration is included in the j-th acceleration section and j is not greater than the number of first objects; When the shake acceleration is included in the jth acceleration section and j is greater than the first number of objects, the nth candidate virtual object of the candidate virtual objects is set as the second virtual object, where n is equal to the first number of objects.

[0194] Here, k and j are positive integers, the candidate virtual objects are arranged in order of distance from the first virtual object to the closest to the furthest, and the k acceleration sections are arranged in order of acceleration values ​​from smallest to largest.

[0195] In one optional embodiment, the receiving module 1202 further comprises: A first location where the mobile terminal is located is acquired by a motion sensor, and the first location is a location where the mobile terminal is located at a start time of a shaking operation; acquiring a second location where the mobile terminal is located by a motion sensor, the second location being a location where the mobile terminal is located at an end time of the shaking operation; The shake direction of the shake operation is determined based on the first position and the second position.

[0196] In one optional embodiment, the receiving module 1202 further comprises: determining a time when the acceleration acquired by the motion sensor is greater than a first threshold as a start time of a shake operation; determining, as an end time of the shake operation, a time when a period during which the acceleration acquired by the motion sensor is smaller than a second threshold reaches a period threshold; The maximum value of the acceleration between the start time and the end time is used to determine the shake acceleration.

[0197] In one optional embodiment, the receiving module 1202 is further used to determine the shake direction and shake amplitude of the shake operation in the image captured by the camera.

[0198] In one optional embodiment, the switching module 1203 is further used to determine a second virtual object based on the shake direction and the shake amplitude, and switch the first virtual object in the locked-on state to the second virtual object.

[0199] In one optional embodiment, the switching module 1203 further comprises: determining a second object number of candidate virtual objects in a shake direction when the first virtual object is set as a reference position in a virtual environment; If the number of second objects is equal to 1, determining a candidate virtual object in the shake direction as a second virtual object; When the number of second objects is greater than 1, the second object number is used to determine a second virtual object from among candidate virtual objects in the shake direction based on the amplitude of the shake.

[0200] In one optional embodiment, the receiving module 1202 further comprises: Obtaining a first image captured by a camera, the first image being captured by the camera at a start time of a shaking operation; obtaining a second image captured by the camera, the second image being captured by the camera at a time when the shaking operation ends; This is used to perform feature point matching based on the first image and the second image and to determine the shake direction of the shake operation.

[0201] In one optional embodiment, the receiving module 1202 further comprises: determining, when a similarity between the first two consecutive frames of images captured by the camera is less than a third threshold, a previous frame of the first two consecutive frames of images as a first image; determining a later frame of the second consecutive two frames of images as a second image when a similarity between the second consecutive two frames of images captured by the camera is greater than a fourth threshold; The degree of similarity between the first image and the second image is used to determine the amplitude of the shake operation.

[0202] In one optional embodiment, the display module 1201 is further used for displaying a first form of a lock-on controller, and the first form of the lock-on controller is used for presenting switching of a virtual object in a locked-on state by a shaking operation.

[0203] In one optional embodiment, the display module 1201 is further used to display at least two virtual objects, the at least two virtual objects including a first virtual object that is not in a locked-on state.

[0204] In one optional embodiment, the display module 1201 is further used for displaying the first virtual object in a locked-on state when the first virtual object satisfies a lock-on condition.

[0205] In one optional embodiment, the display module 1201 further includes: determining a virtual object having a minimum distance from the at least two virtual objects to the master control virtual object as a first virtual object, and displaying the first virtual object in a locked-on state; determining, as a first virtual object, a virtual object whose distance from the at least two virtual objects to the master control virtual object is smaller than a distance threshold and which is in the direction of the master control virtual object, and displaying the first virtual object in a locked-on state; determining a virtual object whose distance from the at least two virtual objects to a master control virtual object is smaller than a distance threshold and whose absolute life value is the smallest as a first virtual object, and displaying the first virtual object in a locked-on state, the absolute life value being a remaining life value of the virtual object, and the life value being used to measure a wear degree of the virtual object in the virtual environment; A virtual object whose distance from the at least two virtual objects to the master control virtual object is smaller than a distance threshold and whose relative life value is the smallest is determined as a first virtual object, and the first virtual object in a locked-on state is displayed, and the relative life value is used to be a ratio between the remaining life value and the full life value of the virtual object.

[0206] In one optional embodiment, the display module 1201 is further used to display a second form of the lock-on controller.

[0207] In one optional embodiment, the display module 1201 is further used for determining the execution of a lock-on operation in response to a first trigger operation on the second form of the lock-on controller.

[0208] In one optional embodiment, the display module 1201 is further used to display a third form of the lock-on controller.

[0209] In one optional embodiment, the display module 1201 is further used to determine the execution of a lock-on cancel operation in response to a second trigger operation on the lock-on controller of the third form.

[0210] In summary, the above device realizes switching of virtual objects in a locked-on state by a shake operation, thereby making it possible to avoid switching caused by touching the lock-on controller multiple times, and enabling the user to quickly switch the lock-on target. For example, when the user finds that a fatal weakness has appeared in the second enemy character for a short period of time while the master-controlled virtual character controlled by the user is engaged in a fierce battle with a first enemy character, the second enemy character can be defeated by the master-controlled virtual character attacking the enemy character. Therefore, the user can switch the virtual character (first enemy character) originally locked on to the second enemy character by a shake operation and attack the switched enemy character. Therefore, setting a shake operation to switch the lock-on target not only enhances the user's operation method, but also improves the efficiency of switching the lock-on target of the user, and further improves the game's attackability.

[0211] 13 shows a block diagram of a computer device 1300 according to an exemplary embodiment of the present application. The computer device 1300 may be a portable mobile terminal such as a smartphone, a tablet PC, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer, or a desktop computer. The computer device 1300 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal, or other names.

[0212] Generally, the computing device 1300 includes a processor 1301 and a memory 1302 .

[0213] The processor 1301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1301 may be realized by adopting at least one type of hardware form among DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1301 may include a main processor and a coprocessor, the main processor is a processor for processing data under a wake-up state and is also called a CPU (Central Processing Unit), and the coprocessor is a low-power processor for processing data under a standby state. In some embodiments, the processor 1301 may be integrated with a GPU (Graphics Processing Unit), which is used to render and draw content that needs to be displayed on a display. In some embodiments, the processor 1301 may further include an AI (Artificial Intelligence) processor, which is used to process computation operations related to machine learning.

[0214] The memory 1302 may include one or more computer-readable storage media, which may be non-transitory. The memory 1302 may further include a high-speed random access memory and a non-volatile memory, such as one or more magnetic disk storage devices, flash storage devices, etc. In some embodiments, the non-transitory computer-readable storage medium in the memory 1302 is used to store at least one instruction, which is executed by the processor 1301 to realize the method of switching a virtual object provided by the method embodiment of the present application.

[0215] In some embodiments, optionally, the computing device 1300 may further include a peripheral interface 1303 and at least one peripheral. The processor 1301, the memory 1302, and the peripheral interface 1303 may be connected via a bus or signal lines. Each peripheral may be connected to the peripheral interface 1303 by a bus, signal lines, or a circuit board. Illustratively, the peripheral may include a display 1304 and a camera assembly 1305.

[0216] In some embodiments, the computing device 1300 may further include one or more sensors 1306, including, but not limited to, an acceleration sensor, a gyro sensor, a pressure sensor, an optical sensor, and a proximity sensor.

[0217] As will be appreciated by those skilled in the art, the configuration illustrated in FIG. 13 is not intended to limit computing device 1300 and may include more or fewer components than those illustrated, combine some components, or employ different arrangements of components.

[0218] The present application further provides a computer-readable storage medium, the storage medium storing at least one segment of a program, the at least one segment of the program being loaded and executed by a processor to realize the virtual object switching method provided by the embodiment of the method described above.

[0219] The present application provides a computer program product, the computer program product including computer instructions, the computer instructions being stored in a computer-readable storage medium, a processor of a computing device reading the computer instructions from the computer-readable storage medium, and the processor executing the computer instructions, such that the computing device performs the virtual object switching method provided in the above embodiment.

Claims

1. A method for switching a virtual object executed by a mobile terminal, comprising: displaying a first virtual object in a locked-on state and a second virtual object not in the locked-on state, the locked-on state indicating that the locked-on virtual object is a target for an action of a master control virtual object; receiving a shake operation, the shake operation being an operation of shaking a body of the mobile terminal; and when the shaking operation matches the second virtual object, switching the first virtual object in the locked-on state to the second virtual object.

2. the step of switching the first virtual object in the locked-on state to the second virtual object includes: displaying a lock-on indicator on the second virtual object and canceling the display of the lock-on indicator on the first virtual object; displaying a lock-on visual effect on the second virtual object and canceling the display of the lock-on visual effect on the first virtual object; A step of displaying presentation information, the presentation information being used to indicate a shaking direction of the shaking operation, and a display method of the presentation information including at least one of a figure, an arrow, and a text; The method of claim 1 , comprising at least one of:

3. The step of receiving a shake operation includes: acquiring the shake direction and the shake acceleration of the shake operation by a motion sensor, the shake acceleration being a maximum acceleration during the shake operation; the step of switching the first virtual object in the locked-on state to the second virtual object when the shaking operation matches the second virtual object, The method of claim 2 , comprising: determining the second virtual object based on the shake direction and the shake acceleration; and switching the first virtual object in the locked-on state to the second virtual object.

4. The step of determining the second virtual object based on the shake direction and the shake acceleration includes: determining a first object number of candidate virtual objects in the shake direction when the first virtual object is set as a reference position in a virtual environment; determining the candidate virtual object in the shake direction as the second virtual object when the first object number is equal to 1; and if the first object number is greater than one, determining the second virtual object from the candidate virtual objects in the shake direction based on the shake acceleration.

5. When the number of the first objects is greater than 1, the step of determining the second virtual object from the candidate virtual objects in the shake direction based on the shake acceleration includes: If the first object number is greater than 1, setting n acceleration sections in the shake direction, where different acceleration sections correspond to positions of different candidate virtual objects; determining, based on an i-th acceleration section including the shake acceleration, a candidate virtual object in the i-th acceleration section as the second virtual object; 5. The method of claim 4, wherein i is a positive integer, the candidate virtual objects are arranged in order of distance from the first virtual object to the closest virtual object, and the n acceleration sections are arranged in order of acceleration value from smallest to largest.

6. When the number of the first objects is greater than 1, the step of determining the second virtual object from the candidate virtual objects in the shake direction based on the shake acceleration includes: if the first object number is greater than 1, acquiring k preset acceleration sections, where k is greater than the first object number; determining a j-th candidate virtual object among the candidate virtual objects as the second virtual object when the shake acceleration is in a j-th acceleration section and j is not greater than the number of the first objects; determining an n-th candidate virtual object among the candidate virtual objects as the second virtual object when the shake acceleration is in the j-th acceleration section and j is greater than the first number of objects, where n is equal to the first number of objects; 5. The method of claim 4, wherein k and j are positive integers, the candidate virtual objects are arranged in order of distance from the first virtual object to the closest to the furthest, and the k acceleration sections are arranged in order of acceleration value from smallest to largest.

7. The step of acquiring the shake direction of the shake operation by a motion sensor includes: A step of acquiring a first location where the mobile terminal is located by the motion sensor, the first location being a location where the mobile terminal is located at a start time of the shaking operation; acquiring a second location of the mobile terminal by the motion sensor, the second location being a location of the mobile terminal at an end time of the shaking operation; and determining the shake direction of the shake operation based on the first position and the second position.

8. The step of acquiring a shake acceleration of the shake operation by a motion sensor includes: determining a time when the acceleration acquired by the motion sensor is greater than a first threshold as a start time of the shaking operation; determining, as an end time of the shaking operation, a time when a period during which the acceleration acquired by the motion sensor is smaller than a second threshold reaches a period threshold; The method according to claim 3 , further comprising: determining as the shake acceleration a maximum value of the acceleration between the start time and the end time.

9. The step of receiving a shake operation includes: determining the shake direction and the shake amplitude of the shaking operation from an image captured by a camera; the step of switching the first virtual object in the locked-on state to the second virtual object when the shaking operation matches the second virtual object, The method according to claim 2 , further comprising: determining the second virtual object based on the shake direction and the shake amplitude; and switching the first virtual object in the locked-on state to the second virtual object.

10. The step of determining the second virtual object based on the shake direction and the shake amplitude includes: determining a second object number of candidate virtual objects in the shake direction when the first virtual object is set as a reference position in a virtual environment; If the second object number is equal to 1, determining the candidate virtual object in the shake direction as the second virtual object; and if the second object number is greater than one, determining the second virtual object from the candidate virtual objects in the shake direction based on an amplitude of the shake.

11. The step of determining the shake direction of the shake operation in an image captured by a camera includes: obtaining a first image captured by the camera, the first image being captured by the camera at a start time of the shaking operation; obtaining a second image captured by the camera, the second image being captured by the camera at a time when the shaking operation ends; and determining the shake direction of the shake operation based on feature point matching between the first image and the second image.

12. The step of determining a shake amplitude of the shaking operation in an image captured by a camera includes: determining a previous frame of the first two consecutive frames of images as a first image when a similarity between the first two consecutive frames of images captured by the camera is less than a third threshold; determining a later frame of the second consecutive two frames of images as a second image when a similarity between the second consecutive two frames of images captured by the camera is greater than a fourth threshold; and determining a shake amplitude of the shake operation based on a similarity between the first image and the second image.

13. 7. The method according to claim 1, further comprising: a step of displaying a lock-on controller in a first form, the lock-on controller in the first form being used to present that a virtual object in the locked-on state is switched by the shaking operation.

14. displaying at least two virtual objects, the at least two virtual objects including a first virtual object that is not in the locked-on state; displaying the first virtual object in the locked-on state when the first virtual object satisfies a lock-on condition; The method of claim 1 , further comprising:

15. When the first virtual object satisfies a lock-on condition, the step of displaying the first virtual object in the locked-on state includes: determining, as the first virtual object, a virtual object that is located at a minimum distance from the master control virtual object among the at least two virtual objects, and displaying the first virtual object in the locked-on state; determining, as the first virtual object, a virtual object of the at least two virtual objects whose distance from the master control virtual object is smaller than a distance threshold and which is in a direction of the master control virtual object, and displaying the first virtual object in the locked-on state; determining, as the first virtual object, a virtual object among the at least two virtual objects whose distance from the master control virtual object is smaller than the distance threshold and whose absolute life value is the smallest, and displaying the first virtual object in the locked-on state, wherein the absolute life value is a remaining life value of the virtual object, and the life value is used to measure a degree of wear of the virtual object in the virtual environment; determining, as the first virtual object, a virtual object among the at least two virtual objects whose distance from the master control virtual object is smaller than the distance threshold and whose relative life value is the smallest, and displaying the first virtual object in the locked-on state, wherein the relative life value is a ratio between a remaining life value and a full life value of the virtual object; The method of claim 14, comprising at least one of:

16. displaying a lock-on controller of a second form; 15. The method of claim 14, further comprising the step of: determining to perform a lock-on operation in response to a first trigger operation on the second form of lock-on controller.

17. displaying a lock-on controller of a third mode; determining to execute a lock-on cancel operation in response to a second trigger operation on the lock-on controller of the third mode; The method of claim 1 , further comprising:

18. A virtual object switching device, comprising: a display module used to display a first virtual object in a locked-on state and a second virtual object not in the locked-on state, the locked-on state indicating that the locked-on virtual object is a target for an action of a master control virtual object; a receiving module for receiving a shake operation, the shake operation being an operation of shaking the device; a switching module adapted to switch the first virtual object in the locked-on state to the second virtual object when the shake operation matches the second virtual object.

19. A computer device including a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to realize a method for switching virtual objects according to any one of claims 1 to 17.

20. A computer-readable storage medium having a computer program stored therein, the computer program being loaded and executed by a processor to realize the virtual object switching method according to any one of claims 1 to 17.

21. 18. A computer program product including computer instructions, the computer instructions being stored in a computer-readable storage medium, the processor of a computing device reading the computer instructions from the computer-readable storage medium, and the processor executing the computer instructions such that the computing device executes and realizes the method for switching virtual objects according to any one of claims 1 to 17.

Citation Information

Patent Citations

  • Information processing method and device, electronic equipment and storage medium

    CN108144293A

  • Method and apparatus for locking virtual object in game, electronic device, and storage medium

    CN110420462A

  • Feature switching method and device in virtual environment, terminal and readable storage medium

    CN111338487A

  • Interaction method and related device

    CN112057862A

  • Game information interaction method and device and computer readable storage medium

    CN112221139A