CN113440841A - Control method and device of virtual role, electronic equipment and readable storage medium - Google Patents

Control method and device of virtual role, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN113440841A
CN113440841A CN202110794314.3A CN202110794314A CN113440841A CN 113440841 A CN113440841 A CN 113440841A CN 202110794314 A CN202110794314 A CN 202110794314A CN 113440841 A CN113440841 A CN 113440841A
Authority
CN
China
Prior art keywords
state
virtual character
target virtual
light spot
input device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110794314.3A
Other languages
Chinese (zh)
Other versions
CN113440841B (en
Inventor
王泽�
胡志鹏
程龙
刘勇成
袁思思
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202110794314.3A priority Critical patent/CN113440841B/en
Publication of CN113440841A publication Critical patent/CN113440841A/en
Application granted granted Critical
Publication of CN113440841B publication Critical patent/CN113440841B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/40Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment
    • A63F13/42Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment by mapping the input signals into game commands, e.g. mapping the displacement of a stylus on a touch screen to the steering angle of a virtual vehicle
    • A63F13/422Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment by mapping the input signals into game commands, e.g. mapping the displacement of a stylus on a touch screen to the steering angle of a virtual vehicle automatically for the purpose of assisting the player, e.g. automatic braking in a driving game
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/56Computing the motion of game characters with respect to other game characters, game objects or elements of the game scene, e.g. for simulating the behaviour of a group of virtual soldiers or for path finding
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/30Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by output arrangements for receiving control signals generated by the game device
    • A63F2300/308Details of the user interface
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/65Methods for processing data by generating or executing the game program for computing the condition of a game character

Abstract

The application provides a control method and device of a virtual role, an electronic device and a readable storage medium, comprising the following steps: acquiring a first state of a reflection light spot corresponding to an input device in the current state of the input device, and controlling a target virtual character to face a first direction corresponding to the first state in the game scene; determining a second state of the reflected light spot when the input device stops rotating in response to the rotation of the input device; and if the second state of the reflected light spot meets the orientation adjustment condition, determining a second direction corresponding to the second state, and controlling the target virtual character to rotate towards the second direction. In the application, according to the orientation adjusting condition met by the second state of the reflected light spot after the input device rotates, the second direction corresponding to the second state is determined, the target virtual character is further controlled to rotate towards the second direction, the adjusting time of the orientation of the target virtual character is saved, and the efficiency of direction adjustment and the human-computer interaction efficiency are improved.

Description

Control method and device of virtual role, electronic equipment and readable storage medium
Technical Field
The present application relates to the field of game technologies, and in particular, to a method and an apparatus for controlling a virtual character, an electronic device, and a readable storage medium.
Background
With the continuous development of scientific technology, 3D (3Dimensions, three-dimensional) games operated by using a spatial stereo computing technology have been greatly developed due to the advantages of strong visual effect, excellent substitution feeling and the like, for example, a large-fleeing and killing type shooting game-chicken game is popular and popular among people, and is highly creative, open, derivative, playable, interactive and ornamental.
In the course of game, in order to better complete task or advance in the game, it is necessary to control the virtual character to move towards a specific direction, in the end game, at the present stage, the virtual character is controlled to rotate in the scene through the sliding operation of the input device connected with the terminal equipment, however, when the virtual character is controlled by the input device, a player needs to move the input device in a large range, a plurality of input device bottom reflection light spots in the moving process are generated and sent to the terminal, and the terminal needs to analyze the track generated by a large number of reflection light spots to determine the rotation direction of the virtual character.
Disclosure of Invention
In view of this, an object of the present application is to provide a method and an apparatus for controlling a virtual character, an electronic device, and a readable storage medium, in which a second direction corresponding to a second state, which the virtual character needs to face, is directly determined according to a change of a state satisfied by a reflected light spot corresponding to an analysis input device and according to a direction adjustment condition satisfied by the second state of the reflected light spot after the input device is rotated, so as to control a target virtual character to rotate towards the second direction, thereby saving adjustment time for the direction of the target virtual character, and facilitating improvement of efficiency of direction adjustment and human-computer interaction efficiency.
In a first aspect, an embodiment of the present application provides a method for controlling a virtual character, in which a terminal device provides a graphical user interface, the graphical user interface displays at least a part of a game scene and a target virtual character, and the terminal device is externally connected with an input device, the method including:
acquiring a first state of a reflection light spot corresponding to the input device in the current state of the input device, and controlling the target virtual character to face a first direction corresponding to the first state in the game scene;
determining a second state of the reflected light spot when the input device stops rotating in response to the rotation of the input device;
if the second state of the reflected light spot meets an orientation adjustment condition, determining a second direction corresponding to the second state in the game scene, and controlling the target virtual character to rotate from the first direction to the second direction; wherein the orientation adjustment condition includes a change in shape of the second state relative to the first state or a change in position of the second state relative to the first state.
In a possible implementation manner, if the second state of the reflected light spot satisfies the orientation adjustment condition, determining a second direction in the game scene corresponding to the second state, and controlling the target virtual character to rotate from the first direction toward the second direction includes:
and when the shape of the second state is changed relative to the first state, controlling the target virtual character to rotate from the first direction to the second direction according to the change direction of the shape of the second state relative to the first state or the change of the light intensity of the second state relative to the first state.
In one possible embodiment, when the orientation adjustment condition that the second state satisfies is that the direction of the shape of the reflected light spot relative to the first state changes, if the second state of the reflected light spot satisfies the orientation adjustment condition, the determining a second direction in the game scene corresponding to the second state and controlling the target virtual character to rotate from the first direction to the second direction includes:
in response to a steering command, determining the second direction according to the shape offset direction and the shape offset distance of the second state relative to the first state;
and controlling the target virtual character to rotate towards the second direction.
In one possible embodiment, before the determining the second direction according to the shape offset direction and the shape offset distance of the second state relative to the first state in response to the steering command, the control method further includes:
detecting whether the shape deviation angle of the second state relative to the first state is larger than a preset angle threshold value or not, and determining that the steering instruction of the input device is received when the shape deviation angle is larger than the preset angle threshold value.
In one possible embodiment, determining the second direction according to the shape offset direction and the shape offset distance of the second state relative to the first state in response to a steering command includes:
determining the rotation direction of the target virtual character according to the shape deviation direction;
determining the rotation angle of the target virtual character according to the shape offset distance;
determining the second direction based on the rotation direction and the rotation angle.
In a possible embodiment, when the orientation adjustment condition that the second state satisfies is that the light intensity of the second state of the reflection light spot changes relative to the first state, if the second state of the reflection light spot satisfies the orientation adjustment condition, determining a second direction in the game scene corresponding to the second state, and controlling the target virtual character to rotate from the first direction to the second direction includes:
when the light intensity of the second state of the reflected light spot is weakened relative to the first state, determining that the direction opposite to the current direction of the target virtual character is the second direction;
and controlling the target virtual character to rotate towards the second direction.
In a possible embodiment, when the orientation adjustment condition is that the shape of the second state is changed relative to the first state, the second direction of the target virtual character includes at least one of:
left of the target avatar, right of the target avatar, front of the target avatar, and back of the target avatar.
In a possible implementation manner, if the second state of the reflected light spot satisfies the orientation adjustment condition, determining a second direction in the game scene corresponding to the second state, and controlling the target virtual character to rotate from the first direction toward the second direction includes:
when the position of the second state relative to the first state changes, determining the moving track of the reflected light spot according to the second position of the second state and the first position of the first state;
and determining a second direction based on the moving direction and the moving distance of the moving track, and controlling the target virtual character to rotate from the first direction to the second direction.
In a possible embodiment, the determining a second direction and controlling the target virtual character to rotate from the first direction to the second direction based on the moving direction and the moving distance of the moving track includes:
determining a direction of rotation of the target virtual character based on the direction of movement;
determining a rotation angle of the target virtual character based on the movement distance;
and determining the second direction based on the rotating direction and the rotating angle, and controlling the target virtual character to rotate from the first direction to the second direction.
In one possible embodiment, while responding to the rotation of the input device, the control method further includes:
determining the movement track of the reflected light spot according to the obtained states of the reflected light spot;
and controlling the target virtual character to move according to the movement track.
In a second aspect, an embodiment of the present application further provides a control device for a virtual character, where a terminal device provides a graphical user interface, the graphical user interface displays at least a part of a game scene and a target virtual character, the terminal device is externally connected with an input device, and the control device includes:
the state acquisition module is used for acquiring a first state of a reflection light spot corresponding to the input device in the current state of the input device and controlling the target virtual character to face a first direction corresponding to the first state in the game scene;
a state determination module for determining a second state of the reflected light spot when the input device stops rotating in response to the rotation of the input device;
the orientation adjusting module is used for determining a second direction corresponding to the second state in the game scene if the second state of the reflected light spot meets an orientation adjusting condition, and controlling the target virtual character to rotate from the first direction to the second direction; wherein the orientation adjustment condition includes a change in shape of the second state relative to the first state or a change in position of the second state relative to the first state.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, when the electronic device runs, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to execute the steps of the method for controlling the virtual character according to any one of the first aspect.
In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the method for controlling a virtual character according to any one of the first aspect.
According to the control method and device for the virtual character, the electronic device and the readable storage medium, the first state of the corresponding reflection light spot of the input device in the current state is obtained, the target virtual character is controlled to face the first direction in the game scene, the rotation of the input device is responded, the second state of the reflection light spot is determined when the input device stops rotating, the second direction corresponding to the second state is determined according to the orientation adjusting condition met by the second state, and then the target virtual character is controlled to rotate from the first direction to the second direction. In the application, according to the change of the state that the reflected light spot that analysis input device corresponds satisfied, according to the orientation adjustment condition that the second state that input device rotated back reflected light spot satisfied, directly determine the second direction that corresponds with the second state that the virtual character needs the orientation, and then control target virtual character and rotate towards the second direction, saved the adjustment time to the orientation of target virtual character, help improving the efficiency and the human-computer interaction efficiency of direction adjustment.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a flowchart of a method for controlling a virtual character according to an embodiment of the present application;
fig. 2 is a flowchart of another control method for a virtual character according to an embodiment of the present disclosure;
fig. 3 is a flowchart of another control method for a virtual character according to an embodiment of the present application;
fig. 4 is a flowchart of another control method for a virtual character according to an embodiment of the present application;
fig. 5 is a flowchart of another control method for a virtual character according to an embodiment of the present application;
FIG. 6 is one of the graphical interface scene diagrams;
FIG. 7 is a second schematic view of a graphical interface scene;
fig. 8 is a schematic structural diagram of a control device for a virtual character according to an embodiment of the present disclosure;
fig. 9 is a second schematic structural diagram of a control apparatus for a virtual character according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. Every other embodiment that can be obtained by a person skilled in the art without making creative efforts based on the embodiments of the present application falls within the protection scope of the present application.
It should be noted that in the embodiments of the present application, the term "comprising" is used to indicate the presence of the features stated hereinafter, but does not exclude the addition of further features.
With the continuous development of scientific technology, 3D (3Dimensions, three-dimensional) games operated by using a spatial stereo computing technology have been greatly developed due to the advantages of strong visual effect, excellent substitution feeling and the like, for example, a large-fleeing and killing type shooting game-chicken game is popular and popular among people, and is highly creative, open, derivative, playable, interactive and ornamental.
In the course of game, in order to better complete task or advance in the game, it is necessary to control the virtual character to move towards a specific direction, in the end game, at the present stage, the virtual character is controlled to rotate in the scene through the sliding operation of the input device connected with the terminal equipment, however, when the virtual character is controlled by the input device, a player needs to move the input device in a large range, a plurality of input device bottom reflection light spots in the moving process are generated and sent to the terminal, and the terminal needs to analyze the track generated by a large number of reflection light spots to determine the rotation direction of the virtual character.
The application aims to provide a control method of a virtual character, so that the adjustment time of the orientation of a target virtual character is saved, and the efficiency of direction adjustment and the efficiency of human-computer interaction are improved.
For facilitating understanding of the present embodiment, a method, an apparatus, an electronic device, and a readable storage medium for controlling a virtual character provided in the embodiments of the present application are described in detail. The embodiment of the application can be applied to the field of games, for example, a game of a Frame Per Second (FPS) type or a game of a Massively Multiplayer Online (MMO) type; the present embodiment is not limited to the above-described type of game, and is also not limited to the field of games.
The control method of the virtual role in the embodiment of the present application may be executed in a terminal device or a server. The terminal device may be a local terminal device (such as a local touch terminal). When the control method of the virtual character runs on the server, the virtual character can be a cloud game.
In an alternative embodiment, cloud gaming refers to a cloud computing-based gaming mode. In the running mode of the cloud game, a running main body of a game program and a game picture presenting main body are separated, the storage and the running of an information display method are completed on a cloud game server, and a cloud game client is used for receiving and sending data and presenting a game picture; however, the terminal device for performing information prompt is a cloud game server at the cloud end. When a game is played, a user operates the cloud game client to send an operation instruction to the cloud game server, the cloud game server runs the game according to the operation instruction, data such as game pictures and the like are encoded and compressed and returned to the cloud game client through a network, and finally the cloud game client decodes the data and outputs the game pictures.
In another alternative embodiment, the terminal device may be a local terminal device. The local terminal device stores a game program and is used for presenting a game screen. The local terminal device is used for interacting with a user through a graphical user interface, namely, a game program is downloaded and installed and operated through the electronic device conventionally. The manner in which the local terminal device provides the graphical user interface to the user may include a variety of ways, for example, it may be rendered for display on a display screen of the local terminal device or provided to the user by holographic projection. For example, the local terminal device may include a display screen for presenting a graphical user interface including a game screen and a processor for running the game, generating the graphical user interface, and controlling display of the graphical user interface on the display screen.
The control method for the virtual character provided by the embodiment of the application can be operated in the aforementioned local terminal device and can also be operated in the aforementioned cloud game client. The following description will take an example in which the control method of the virtual character described above is executed in a local terminal device (hereinafter, simply referred to as a terminal device).
Referring to fig. 1, fig. 1 is a flowchart illustrating a control method for a virtual character according to an embodiment of the present disclosure. As shown in fig. 1, a method for controlling a virtual character provided in an embodiment of the present application includes:
s101, acquiring a first state of a reflection light spot corresponding to the input device when the input device is in the current state, and controlling the target virtual character to face a first direction corresponding to the first state in the game scene;
s102, responding to the rotation of the input device, and determining a second state of the reflection light spot when the input device stops rotating;
s103, if the second state of the reflected light spot meets the orientation adjustment condition, determining a second direction corresponding to the second state in the game scene, and controlling the target virtual character to rotate from the first direction to the second direction.
Wherein the orientation adjustment condition includes a change in shape of the second state relative to the first state or a change in position of the second state relative to the first state.
According to the control method of the virtual character, the change of the state met by the reflecting light spot corresponding to the input device is analyzed, the second direction corresponding to the second state, which needs to be oriented by the virtual character, is directly determined according to the orientation adjusting condition met by the second state of the reflecting light spot after the input device rotates, and then the target virtual character is controlled to rotate towards the second direction, so that the adjusting time of the orientation of the target virtual character is saved, and the direction adjusting efficiency and the human-computer interaction efficiency are improved.
The following describes exemplary steps in an embodiment of the present application:
s101, acquiring a first state of a reflection light spot corresponding to the input device when the input device is in the current state, and controlling the target virtual character to face a first direction corresponding to the first state in the game scene.
In the embodiment of the application, a first state of a reflection facula reflected by a bottom light ray of the input device in the current state of the input device is obtained, and a first direction corresponding to the first state of the target virtual character in a game scene is controlled.
Here, in the embodiment of the present application, the input device may refer to a mouse connected to the terminal, and in the embodiment of the present application, the mouse refers to an optical mouse, a light emitting diode is disposed inside the optical mouse, and a light emitted by the light emitting diode illuminates a bottom surface of the optical mouse, so as to generate a reflected light spot, and a portion of the light reflected by the bottom surface of the optical mouse passes through a set of optical lenses and then is transmitted to a light sensing device (micro imager) for imaging. Therefore, when the optical mouse moves, the moving track of the optical mouse is recorded as a group of consecutive images shot at a high speed, the consecutive images are analyzed and processed by a special image analysis chip (DSP, namely a digital microprocessor) in the optical mouse, the moving direction and the moving distance of the optical mouse are judged according to the moving track formed by a plurality of reflecting light spots, the cursor positioning in a game scene is completed, and the target virtual character in the game is controlled to move according to the moving direction and the moving distance of the cursor.
Here, the first state of the reflection spot corresponding to the input device includes a shape of the reflection spot and a position of the reflection spot with respect to the input device.
Here, the current state for the input device may include: the input device is normally placed, the input device is inclined to the left, the input device is inclined to the right and the input device is lifted, the first state of the corresponding reflection light spot can be that the reflection light spot is in the right center position relative to the input device, the reflection light spot is in a normal non-offset shape, the reflection light spot is in a shape that the reflection light spot is offset to the right, the reflection light spot is in a shape that the reflection light spot is offset to the left, and the light intensity of the reflection light spot is weakened.
Here, the mapping relationship between the first state of the reflection spot and the first direction may be set in advance in the game setting, or the first state of the reflection spot and the first direction may correspond to each other, for example, the shape of the reflection spot is determined to be shifted to the right, the current state of the input device is determined to be shifted to the left, and the first direction is also the left direction, and the target virtual character faces the left direction in the game scene.
It should be noted that, when the current state of the input device is normally placed, that is, the first state of the corresponding reflection spot is a reflection spot at the right center position with respect to the input device, and the reflection spot shape is a normal non-offset shape, the orientation of the target avatar is forward (toward the right front of the target avatar).
And S102, responding to the rotation of the input device, and determining a second state of the reflection light spot when the input device stops rotating.
In the embodiment of the present application, the second state of the corresponding reflected light spot when the input device stops rotating is determined in response to the input device being rotated by the player.
Here, the rotation for the input device may be tilting the input device left to right (moving along the X-axis of the plane in which the input device lies); or may be an operation of lifting the input device (moving along the Y-axis of the plane in which the input device is located).
Here, the judgment of the stop of the movement of the input device during the rotation process may be that after receiving one reflected light spot, the reflected light spot at different positions is not received within a preset interval time, it is determined that the input device stops rotating, or the player lifts the input device while controlling the input device (the received light of the reflected light spot is significantly weakened), and does not change after the preset interval time, and at this time, the input device is considered to stop rotating, or the state of the reflected light spot corresponding to the input device does not change within the preset interval time, and at this time, the input device is considered to stop rotating.
Here, the second state of the reflection light spot is consistent with the first state, and also includes the shape of the reflection light spot and the position of the reflection light spot relative to the input device, and the corresponding relationship between the second state of the input device and the second state of the reflection light spot is consistent with the corresponding relationship between the current state of the input device and the first state of the reflection light spot, and details are not repeated again.
S103, if the second state of the reflected light spot meets the orientation adjustment condition, determining a second direction corresponding to the second state in the game scene, and controlling the target virtual character to rotate from the first direction to the second direction.
In the embodiment of the application, if the second state of the reflected light spot satisfies the preset orientation adjustment condition, a second direction corresponding to the second state of the reflected light spot in the game scene is determined, and the target virtual character is controlled to rotate from the first direction to the second direction.
Here, when the orientation adjustment condition is that the shape of the second state is changed from the first state, the second direction of the target virtual character includes at least one of: left of the target avatar, right of the target avatar, front of the target avatar, and back of the target avatar.
Here, the orientation adjustment condition includes that the shape of the second state is changed from the first state, or that the position of the second state is changed from the first state, that is, the second state and the first state are always different from each other, and the shapes of the second state and the first state may be different from each other, or the shapes and the positions of the second state and the first state may be different from each other.
Here, the present embodiment proposes a method for controlling a target virtual character to rotate in a target direction in a game scene to some extent even when a state of one reflection spot changes, without changing an orientation of the target virtual character according to a trajectory formed by the reflection spots corresponding to the input device.
In the embodiment of the present application, the second state of the reflected light spot at the bottom of the input device satisfies different orientation adjustment conditions, and the corresponding ways of controlling the target virtual character to rotate from the first direction to the second direction are also different, which are respectively described below:
first, when the second state of the reflected light spot satisfies the orientation adjustment condition that the shape of the second state changes relative to the first state:
the step of determining a second direction corresponding to the second state in the game scene and controlling the target virtual character to rotate from the first direction to the second direction if the second state of the reflected light spot satisfies the orientation adjustment condition when the orientation adjustment condition satisfied by the second state is that the direction of the shape of the second state of the reflected light spot is changed relative to the first state includes:
and when the shape of the second state is changed relative to the first state, controlling the target virtual character to rotate from the first direction to the second direction according to the change direction of the shape of the second state relative to the first state or the change of the light intensity of the second state relative to the first state.
In the embodiment of the application, when the shape of the second state changes relative to the shape of the first state, a second direction in which the target virtual character needs to be steered is determined according to the change direction of the shape of the second state relative to the shape of the first state or the change of the light intensity of the second state relative to the first state, and then the target virtual character is controlled to rotate towards the second direction.
Here, the change in the shape of the second state with respect to the first state includes a change in the shape of the second state with respect to the first state including a change direction of the shape of the second state with respect to the first state and a change in the intensity of light of the second state with respect to the first state.
The reason why the direction of the shape of the second state is changed (shifted) from the first state is that the player tilts the input device when controlling the input device, specifically, if the second state is shifted to the left from the first state, it is determined that the player has tilted the mouse to the right, and if the second state is shifted to the right from the first state, it is determined that the player has tilted the mouse to the left.
The light intensity change of the second state relative to the first state is caused by that the player lifts or puts down the input device when controlling the input device, and specifically, if the light intensity of the second state relative to the first state is weakened, it is determined that the player lifts the input device.
Here, a corresponding relationship between the state change of the reflection light spot and the direction in which the target virtual character needs to turn is set in advance in the game setting, and the second direction in which the target virtual character needs to turn is determined according to the second state of the obtained reflection light spot satisfying the orientation adjustment condition, so that the target virtual character is controlled to rotate in the second direction in the game scene.
Here, the change in the shape of the second state with respect to the first state includes two different changes, that is, a change in the shape of the second state with respect to the first state, including a change in the direction of the change in the shape of the second state with respect to the first state and a change in the intensity of light of the second state with respect to the first state, and there is a difference in the manner of controlling the target avatar to rotate from the first direction toward the second direction with respect to the different changes, and the following description is made separately:
(1) when the orientation adjustment condition that the second state satisfies is that the direction of the second state of the reflected light spot changes relative to the shape of the first state:
referring to fig. 2, fig. 2 is a flowchart of another control method for a virtual role according to an embodiment of the present application. As shown in fig. 2, the method for controlling a virtual character according to the embodiment of the present application, where the step "if the second state of the reflected light spot satisfies the orientation adjustment condition, determine a second direction in the game scene corresponding to the second state, and control the target virtual character to rotate from the first direction to the second direction", includes:
s201, responding to a steering command, and determining the second direction according to the shape offset direction and the shape offset distance of the second state relative to the first state.
In the embodiment of the application, in response to a rotation instruction, a second direction in which the control target virtual character needs to be steered is correspondingly determined according to the shape offset direction and the shape offset distance of the second state relative to the first state.
Here, the shape offset direction and the shape offset distance of the second state with respect to the first state may be determined in two ways:
the first method is as follows: and determining the second direction according to the shape deviation direction of the second state relative to the first state.
In the embodiment of the application, according to the shape deviation direction of the second state of the reflected light spot of the input device relative to the first state, the second direction corresponding to the shape deviation direction, which needs to be controlled, of the orientation of the target virtual character is determined.
Here, the direction of the shape deviation of the second state of the reflected light spot from the first state at the bottom of the input device is caused by the player tilting the input device when operating the input device, and the direction of the shape deviation of the second state of the reflected light spot from the first state also corresponds to the direction of the tilt of the input device by the player, and the second direction is determined according to the direction of the tilt of the input device.
However, since the tilt direction of the input device is generally two operation modes of tilting the input device to the left and tilting the input device to the right from the viewpoint of the operational convenience of the player, and correspondingly, the shape deviation direction of the second state of the reflected light spot at the bottom of the input device with respect to the first state is also divided into a left deviation and a right deviation, when the second direction in which the target virtual character needs to be turned is determined from the shape deviation direction of the second state of the reflected light spot with respect to the first state, there are two target directions of turning to the right (90 ° to the right) and turning to the left (90 ° to the left) of the target virtual character.
And determining the second direction according to the shape offset direction and the shape offset distance of the second state relative to the first state.
Referring to fig. 3, fig. 3 is a flowchart of another control method for a virtual role according to an embodiment of the present application. As shown in fig. 3, the method for controlling a virtual character according to an embodiment of the present application, in which "in response to a steering command, the second direction is determined according to a shape offset direction and a shape offset distance of the second state with respect to the first state", includes:
s301, determining the rotation direction of the target virtual character according to the shape deviation direction.
S302, determining the rotation angle of the target virtual character according to the shape offset distance.
S303, determining the second direction based on the rotating direction and the rotating angle.
In the embodiment of the application, the direction in which the target virtual character needs to rotate is determined according to the obtained shape deviation direction of the second state of the reflected light spot at the bottom of the input device relative to the first state. And determining a rotation angle of the target virtual character which needs to be rotated according to the shape offset distance of the second state of the reflection light spot relative to the first state, and determining a second direction in which the target virtual character needs to be turned according to the determined rotation direction and the determined rotation angle.
Here, the determination of the rotation direction of the target avatar according to the shape deviation direction of the second state of the reflected light spot relative to the first state at the bottom of the input device is consistent with the determination of the target direction according to the shape deviation direction of the second state of the reflected light spot relative to the first state, and details thereof are omitted here.
Here, the determination of the rotation direction of the target avatar based on the shape deviation direction of the second state of the reflected light spot at the bottom of the input device from the first state is only a rough rotation direction of the target avatar, and there may be a case where the target avatar rotates directly to the left or directly to the right, and therefore, in order to more accurately determine the second direction in which the target avatar needs to rotate, a specific rotation angle may be determined based on the shape deviation distance of the second state of the reflected light spot at the bottom of the input device from the first state.
Here, the correspondence between the shape offset distance of the second state of the reflected light spot from the first state and the turning angle by which the target virtual character needs to be turned may be set in advance at the time of game setup.
Here, the directions corresponding to different shape offset distances may be preset, and the distances at which the reflected light spots may be offset are divided into a plurality of distance sections, and each distance section corresponds to a rotation angle of one target virtual character.
The division of the distance intervals can be determined by performing equidistant division on the distances at which the reflected light spots can deviate, or the distance intervals corresponding to the rotation angles of the player-controlled target virtual character are appropriately enlarged according to the historical operation information of the player, which is determined as the requirement of the player for controlling the target virtual character; the determination may be performed according to game progress information in the current game scene, for example, the distance interval corresponding to the direction in which the target virtual character exists in the special area (replenishment area), the direction in which the enemy character exists, and the direction in which the teammate character exists is appropriately increased.
Here, after the rotation direction and the rotation angle are determined, the control target virtual character rotates by the corresponding rotation angle toward the rotation direction.
Here, for the scheme of controlling the target virtual character to rotate in the second direction according to the shape offset direction and the shape offset distance of the second state of the reflection spot of the input device with respect to the first state, the rotation range is from right rotation (90 ° to right) to left rotation (90 ° to left) and is a gradual process in the process of left or right rotation, for example, the target virtual character is controlled to rotate 45 ° to the right, then the target virtual character is controlled to rotate 90 ° to the right, and the rotation reaches the right direction of the target virtual character.
Here, when the second direction of the target avatar is determined according to the shape offset direction and the shape offset distance of the second state of the reflection spot of the input device relative to the first state, because the offset angle of the input device is limited, when the offset angle is too large, the capture of the reflection spot at the bottom of the input device may fail, and thus the target avatar cannot be controlled, that is, the offset distance of the reflection spot is relatively small, so that in the process of setting the rotation angle corresponding to the distance, the rotation angle is not finely divided, and the rotation angle may be divided into relatively well captured angles such as 0 °, 45 °, 90 °, or 0 °, 30 °, 60 °, 90 °, so as to complete the control of the rotation of the target avatar.
In one possible embodiment, before the step "determining the second direction according to the shape offset direction and the shape offset distance of the second state with respect to the first state in response to the steering command", the control method further includes:
detecting whether the shape deviation angle of the second state relative to the first state is larger than a preset angle threshold value or not, and determining that the steering instruction of the input device is received when the shape deviation angle is larger than the preset angle threshold value.
In this embodiment of the application, according to whether the received shape deviation angle of the second state relative to the first state is greater than a preset angle threshold, when it is determined that the shape deviation angle is greater than the preset threshold, it is determined that the change of the shape of the second state of the reflected light spot of the input device captured this time relative to the first state is valid, that is, a valid rotation instruction is received.
Here, the preset angle threshold is set to prevent the player from performing an operation of triggering the target virtual character to turn by an erroneous operation when controlling the input device, which affects the normal game progress.
The preset angle threshold value can be determined according to offset data of a plurality of historical reflected light spot positions obtained by a player operating the input device, the offset angles of the shapes of the reflected light spots, which are smaller than or equal to the preset angle threshold value, are considered as operations which do not trigger the memorial rotation of the control target virtual character, and the change of the reflected light spots at the bottom of the input device is ignored at the moment, so that misoperation is prevented.
Here, when an operation that the reflected light spot at the bottom of the input device is shifted is continuously received within a period of time, and a control operation that the player wants to trigger the control target virtual character to turn is also considered, at this time, a prompt message may be displayed on the graphical user interface to prompt the player to increase the tilt angle of the input device, so that the terminal obtains the reflected light spot of which the shape shift angle is greater than the preset angle threshold value, to trigger the steering instruction for the control target virtual character to turn. The display of the prompt on the graphical user interface may prompt the player to increase the instruction to tilt the input device, such as: please increase the angle of tilting the mouse, etc.
Here, when the operation that the reflected light spot at the bottom of the input device is shifted is continuously received within a period of time, it is also possible to directly display the inquiry information on the gui, and determine whether to start the operation of controlling the target avatar to rotate according to the area clicked by the player operating the input device on the gui.
For example, the information "whether to control the character to rotate" is displayed on the graphical user interface, two click areas of "yes" and "no" are provided, and when it is determined that a click operation is received at the click area of "yes", a steering instruction for controlling the target virtual character to steer is triggered.
S202, controlling the target virtual role to rotate towards the second direction.
In the embodiment of the application, according to the determined second direction, the target virtual character is controlled to rotate from the initial first direction to the determined second direction.
(2) When the orientation adjustment condition that the second state satisfies is that the light intensity of the second state of the reflected light spot is changed relative to the first state:
the step of determining a second direction corresponding to the second state in the game scene and controlling the target virtual character to rotate from the first direction to the second direction if the second state of the reflected light spot satisfies the direction adjustment condition includes:
and when the light intensity of the second state of the reflection light spot relative to the first state is determined to be weakened, determining the direction opposite to the current direction of the target virtual character as the second direction, and controlling the target virtual character to rotate towards the second direction.
In the embodiment of the application, when the light intensity of the second state of the reflected light spot is detected to be weakened relative to the light intensity of the first state, the direction opposite to the current direction of the target virtual character is determined as the second direction, and the target virtual character is controlled to rotate towards the second direction.
Here, when it is detected that the intensity of the light of the reflected light spot is decreased, it may be determined that the player lifts the input device, and then the target virtual character may be directly controlled to be oriented in a second direction opposite to the current direction, and further, the target virtual character may be controlled to be rotated in the second direction opposite to the current direction.
Secondly, when the second state of the reflected light spot satisfies the orientation adjustment condition that the position of the second state relative to the first state changes:
referring to fig. 4, fig. 4 is a flowchart of another control method for a virtual character according to an embodiment of the present application. As shown in fig. 4, the method for controlling a virtual character according to the embodiment of the present application, where the step "if the second state of the reflected light spot satisfies the orientation adjustment condition, determine a second direction in the game scene corresponding to the second state, and control the target virtual character to rotate from the first direction to the second direction", includes:
s401, when the position of the second state relative to the first state changes, determining the moving track of the reflection light spot according to the second position of the second state and the first position of the first state.
In this embodiment of the application, when the orientation adjustment condition that the second state of the reflection light spot satisfies is that the position of the second state relative to the first state changes, the movement track of the reflection light spot is determined according to the second position of the reflection light spot relative to the mouse in the second state and the first position of the reflection light spot relative to the mouse in the first state.
Here, the movement locus of the reflected light spot includes a movement direction and a movement distance of the reflected light spot from the first position to the second position, and the movement direction and the movement distance may be determined by determining a line segment with the first position as a starting point and the second position as an end point, determining the movement direction based on an included angle of the line segment with respect to a straight line where the first position is located, and determining the length of the line segment as the movement distance.
S402, determining a second direction based on the moving direction and the moving distance of the moving track, and controlling the target virtual character to rotate from the first direction to the second direction.
In the embodiment of the present application, according to the moving direction and the moving distance of the moving track determined in step S402, a second direction corresponding to the second state of the reflected light spot is determined, and the target virtual character is controlled to rotate from the first direction to the second direction.
Here, the determination of the second direction based on the moving direction and the moving distance of the moving trajectory may be classified into the following three types:
the first method is as follows: and determining a second direction according to the moving direction of the moving track.
In this embodiment of the application, a correspondence between the moving direction of the moving track for different reflection light spots and the second direction may be preset, and after the moving direction of the moving track is determined, the second direction is determined according to the moving direction.
And the moving direction of the reflection light spot indicated by the moving track is directly determined according to the direction of the second position of the second state of the reflection light spot relative to the first position of the first state of the reflection light spot, and the corresponding second direction is directly determined.
For example, if the second position determining the second state of the reflected light spot is to the left of the first position determining the first state of the reflected light spot, i.e. the moving direction of the moving track is to the left, then the corresponding second direction may be determined to be towards the left.
The second method comprises the following steps: and determining a second direction according to the moving distance of the moving track.
In the embodiment of the application, the directions corresponding to different moving distances may be preset, the moving distance corresponding to the moving track is divided into multiple distance intervals, and each distance interval corresponds to one second direction.
For example, the moving distance (20cm) corresponding to the moving track may be divided into four segments, where the second direction corresponding to 0-5cm is the right direction, the second direction corresponding to 6-10cm is the back direction, the second direction corresponding to 10-15cm is the left direction, and the second direction corresponding to 15-20cm is the front direction, and when it is determined that the moving distance corresponding to the moving track of this time is 7cm and is within the distance interval of 6-10cm, then the second direction is the back direction.
The division of the distance intervals and the second direction corresponding to each distance interval are preset in the game setting process. The distance interval corresponding to the direction in which the player frequently turns is appropriately increased according to the historical operation information of the player, for example, the direction in which the target virtual character exists in a special area (replenishment area), the direction in which an enemy character exists, and the distance interval corresponding to the direction in which a teammate character exists are appropriately increased.
And determining a second direction according to the moving direction and the moving distance.
In this application, the step of determining a second direction and controlling the target virtual character to rotate from the first direction to the second direction based on the moving direction and the moving distance of the moving trajectory includes: determining a direction of rotation of the target virtual character based on the direction of movement; determining a rotation angle of the target virtual character based on the movement distance; and determining the second direction based on the rotating direction and the rotating angle, and controlling the target virtual character to rotate from the first direction to the second direction.
In this embodiment of the application, a manner of determining the second direction according to the moving direction and the moving distance is consistent with a manner of determining the second direction according to the moving direction and the moving distance when the orientation adjustment condition that the second state of the reflected light spot satisfies is that the direction of the shape of the second state relative to the first state changes, and is not described herein again.
In the embodiment of the present application, in the adjustment process of determining the second direction and rotating the orientation of the target virtual character from the first direction to the second direction, the adjustment manner according to the change in the shape of the second state relative to the first state and the adjustment manner according to the change in the position of the second state relative to the first state may be to adjust the target virtual character alone, or may be to adjust the orientation of the target virtual character by combining the two ways to complement each other.
Taking an example of combining an adjustment mode that the shape of the reflected light spot changes relative to the first state according to the second state and an adjustment mode that the position of the second state changes relative to the first state, according to the first state of the reflected light spot relative to the second state of the reflected light spot corresponding to the input device, it is found that the shape of the reflected light spot shifts rightward relative to the reflected light spot in the first state in the second state, at this time, it can be determined that the target virtual character needs to be controlled to rotate leftward, and then it is determined that the target virtual character needs to rotate 30 ° according to the moving distance between the second position indicated in the second state of the reflected light spot and the first position in the first state, and then the jointly determined second direction is the target virtual character rotates 30 ° leftward.
Referring to fig. 5, fig. 5 is a flowchart of another control method for a virtual character according to an embodiment of the present disclosure. As shown in fig. 5, the control method for a virtual character provided in the embodiment of the present application, in one possible real-time manner, while responding to the rotation of the input device, further includes:
s501, determining the movement track of the reflection light spot according to the obtained states of the reflection light spot.
And S502, controlling the target virtual character to move according to the movement track.
In the embodiment of the application, the target virtual character is controlled to move in the game scene according to the movement track formed by the received multiple states of the reflection light spots at the bottom of the input device and the movement direction and the movement distance corresponding to the movement track.
Here, when the control avatar rotates, it may be directed to the target avatar rotating in situ, and the movement of the control avatar may be determined by forming a movement trajectory according to a plurality of states of the reflection spot of the input device, and thus, the control target avatar may also move while the control target avatar rotates.
Here, when the control target virtual character moves in the game scene, it is necessary to acquire a plurality of states of the continuous reflection spots, and a plurality of states of the reflection spots during the movement of the primary input device.
Wherein the plurality of states of the reflection light spot for the primary input device may be a plurality of states of the reflection light spot according to the bottom of the input device received within a preset time period; or a plurality of states of the reflected light spot before the input device stops moving in the continuous moving process; there may be a plurality of states of the reflected light spot within a predetermined range, and the reflected light spot within the predetermined range may be regarded as an ineffective reflected light spot.
The input device may stop moving during the continuous movement process, after receiving one reflected light spot and no reflected light spot at different positions is received within a preset interval time period, the input device is determined to stop moving, or the player lifts the input device while controlling the input device (the received light of the reflected light spot is obviously weakened), and the input device is considered to stop moving.
Here, when the target virtual character is controlled to move in the game scene by the input device, the movement direction and the movement distance of the input device may be determined based on the received movement locus of the reflection spot of the input device during movement, and the movement direction and the movement distance of the target virtual character may be determined based on the corresponding relationship between the movement of the input device and the movement of the target virtual character, so as to control the target virtual character to move in the game scene.
The mapping relationship between the movement distance of the input device and the movement distance of the target virtual character is preset in game setting, and can be set according to specific requirements of specific games or historical game data.
The corresponding relationship between the moving distance of the target virtual character in the game scene and the moving distance of the input device may be a corresponding relationship between a distance section and a distance section, for example, the moving distance section of the input device is 0-5cm, and correspondingly the moving distance section of the target virtual character in the game scene may be 0-10 km (game distance).
Here, the determination of the moving direction of the input device may be performed by using the position of the bottom reflection spot when the input device does not start moving as an origin, determining a direction and an angle of a moving track formed by a plurality of states of the reflection spot during the movement of the input device, which deviates from the origin, and further determining the moving direction of the input device, which is also the moving direction of the target virtual character in the game scene.
The moving direction of the target virtual character may include a rotating direction and a rotating angle, for example, the target virtual character is controlled to rotate 30 ° to the right.
In a possible implementation manner, after the step "if the second state of the reflected light spot satisfies the orientation adjustment condition, determining a second direction in the game scene corresponding to the second state, and controlling the target virtual character to rotate from the first direction toward the second direction", the control method further includes:
and switching the first game picture corresponding to the first direction to the second game picture corresponding to the second direction.
In the embodiment of the present application, after the orientation of the target virtual character is adjusted, it is also necessary to switch the first game screen corresponding to the first direction of the graphical user interface to the second game screen corresponding to the second direction.
Here, the switching of the first game screen to the second game screen may be a gradual process, and as the target virtual character rotates, the game screen in the direction toward which the target virtual character faces at each moment is presented in real time; the method can also be a direct switching process, and after the target virtual character is turned to the second direction, the first game picture corresponding to the first direction of the graphical user interface is directly switched to the second game picture corresponding to the second direction.
The following describes, with reference to the specific example and the corresponding drawings, a process of adjusting the orientation of a character in a game scene by using a mouse, please refer to fig. 6 and 7, where fig. 6 is one of schematic diagrams of graphical interface scenes; fig. 7 is a second schematic view of a graphical interface scene, and as shown in fig. 6 and 7, the adjustment process of the character orientation in the game scene is as follows:
step 1: when the game starts, as shown in fig. 6, the current state of the mouse 610 is a normal placement state, the reflection light spot 620 corresponding to the mouse 610 is in a normal state, that is, the reflection light spot 620 is in a normal shape without offset at the center position relative to the input device, the orientation of the target virtual character 631 located in the graphical user interface 630 is determined to be a forward direction, and a tree 632 in front of the target virtual character is displayed in the graphical user interface 630;
step 2: when it is determined that the player controls the mouse 610 to rotate, the state of the reflected light spot 620 when the mouse 610 stops rotating is determined, and as shown in fig. 7, the reflected light spot 620 is now in a state where the shape is shifted to the left, and it is known that the player tilts the mouse 610 to the right at this time, the target virtual character 631 located in the graphic user interface 630 is controlled to rotate to the right, and the house 633 to the left of the target virtual character is shown in the graphic user interface 630.
According to the control method of the virtual character, the first state of the corresponding reflection light spot of the input device in the current state is obtained, the target virtual character is controlled to face the first direction in the game scene, the rotation of the input device is responded, the second state of the reflection light spot is determined when the input device stops rotating, the second direction corresponding to the second state is determined according to the orientation adjusting condition met by the second state, and then the target virtual character is controlled to rotate from the first direction to the second direction. In the application, according to the change of the state that the reflected light spot that analysis input device corresponds satisfied, according to the orientation adjustment condition that the second state that input device rotated back reflected light spot satisfied, directly determine the second direction that corresponds with the second state that the virtual character needs the orientation, and then control target virtual character and rotate towards the second direction, saved the adjustment time to the orientation of target virtual character, help improving the efficiency and the human-computer interaction efficiency of direction adjustment.
Based on the same inventive concept, the embodiment of the present application further provides a control apparatus for a virtual character corresponding to the control method for a virtual character, and since the principle of the apparatus in the embodiment of the present application for solving the problem is similar to the control method in the embodiment of the present application, the implementation of the apparatus may refer to the implementation of the method, and repeated details are not described again.
Referring to fig. 8 and 9, fig. 8 is a first schematic structural diagram of a control device for a virtual character according to an embodiment of the present disclosure, and fig. 9 is a second schematic structural diagram of a control device for a virtual character according to an embodiment of the present disclosure. As shown in fig. 8, the control device 800 includes:
a state obtaining module 810, configured to obtain a first state of a reflection spot corresponding to the input device in a current state of the input device, and control the target virtual character to face a first direction corresponding to the first state in the game scene;
a state determination module 820 for determining a second state of the reflected light spot when the input device stops rotating in response to the rotation of the input device;
an orientation adjustment module 830, configured to determine a second direction in the game scene corresponding to the second state if the second state of the reflected light spot satisfies an orientation adjustment condition, and control the target virtual character to rotate from the first direction toward the second direction; wherein the orientation adjustment condition includes a change in shape of the second state relative to the first state or a change in position of the second state relative to the first state.
In a possible implementation, as shown in fig. 9, the control apparatus 800 further includes an offset determining module 840, where the offset determining module 840 is configured to:
detecting whether the shape deviation angle of the second state relative to the first state is larger than a preset angle threshold value or not, and determining that the steering instruction of the input device is received when the shape deviation angle is larger than the preset angle threshold value.
In a possible implementation, as shown in fig. 9, the control device 800 further includes a movement control module 850, where the movement control module 850 is configured to:
determining the movement track of the reflected light spot according to the obtained states of the reflected light spot;
and controlling the target virtual character to move according to the movement track.
In a possible implementation manner, when the orientation adjustment module 830 is configured to determine a second direction in the game scene corresponding to the second state if the second state of the reflected light spot satisfies the orientation adjustment condition, and control the target virtual character to rotate from the first direction to the second direction, the orientation adjustment module 830 is configured to:
and when the shape of the second state is changed relative to the first state, controlling the target virtual character to rotate from the first direction to the second direction according to the change direction of the shape of the second state relative to the first state or the change of the light intensity of the second state relative to the first state.
In a possible implementation manner, when the orientation adjustment condition that the second state satisfies is that the direction of the shape of the reflected light spot relative to the first state changes, the orientation adjustment module 830, when configured to determine a second direction corresponding to the second state in the game scene if the second state of the reflected light spot satisfies the orientation adjustment condition, and control the target virtual character to rotate from the first direction to the second direction, the orientation adjustment module 830 is configured to:
in response to a steering command, determining the second direction according to the shape offset direction and the shape offset distance of the second state relative to the first state;
and controlling the target virtual character to rotate towards the second direction.
In one possible implementation, when the orientation adjustment module 830 is configured to determine the second direction according to a shape offset direction and a shape offset distance of the second state relative to the first state in response to a steering instruction, the orientation adjustment module 830 is configured to:
determining the rotation direction of the target virtual character according to the shape deviation direction;
determining the rotation angle of the target virtual character according to the shape offset distance;
determining the second direction based on the rotation direction and the rotation angle.
In a possible implementation manner, when the orientation adjustment condition that the second state satisfies is that the light intensity of the second state of the reflected light spot changes relative to the first state, the orientation adjustment module 830, when the orientation adjustment module 830 is configured to determine a second direction in the game scene corresponding to the second state if the second state of the reflected light spot satisfies the orientation adjustment condition, and control the target virtual character to rotate from the first direction toward the second direction, the orientation adjustment module 830 is configured to:
when the light intensity of the second state of the reflected light spot is weakened relative to the first state, determining that the direction opposite to the current direction of the target virtual character is the second direction;
and controlling the target virtual character to rotate towards the second direction.
In a possible embodiment, when the orientation adjustment condition is that the shape of the second state is changed relative to the first state, the second direction of the target virtual character includes at least one of:
left of the target avatar, right of the target avatar, front of the target avatar, and back of the target avatar.
In a possible implementation manner, when the orientation adjustment module 830 is configured to determine a second direction in the game scene corresponding to the second state if the second state of the reflected light spot satisfies the orientation adjustment condition, and control the target virtual character to rotate from the first direction to the second direction, the orientation adjustment module 830 is configured to:
when the position of the second state relative to the first state changes, determining the moving track of the reflected light spot according to the second position of the second state and the first position of the first state;
and determining a second direction based on the moving direction and the moving distance of the moving track, and controlling the target virtual character to rotate from the first direction to the second direction.
In a possible implementation manner, when the orientation adjustment module 830 is configured to determine a second direction based on the moving direction and the moving distance of the moving track, and control the target virtual character to rotate from the first direction to the second direction, the orientation adjustment module 830 is configured to:
determining a direction of rotation of the target virtual character based on the direction of movement;
determining a rotation angle of the target virtual character based on the movement distance;
and determining the second direction based on the rotating direction and the rotating angle, and controlling the target virtual character to rotate from the first direction to the second direction.
According to the control device of the virtual character, the first state of the corresponding reflection light spot of the input device in the current state is obtained, the target virtual character is controlled to face the first direction in a game scene, the rotation of the input device is responded, the second state of the reflection light spot is determined when the input device stops rotating, the second direction corresponding to the second state is determined according to the orientation adjusting condition met by the second state, and then the target virtual character is controlled to rotate from the first direction to the second direction. In the application, according to the change of the state that the reflected light spot that analysis input device corresponds satisfied, according to the orientation adjustment condition that the second state that input device rotated back reflected light spot satisfied, directly determine the second direction that corresponds with the second state that the virtual character needs the orientation, and then control target virtual character and rotate towards the second direction, saved the adjustment time to the orientation of target virtual character, help improving the efficiency and the human-computer interaction efficiency of direction adjustment.
Referring to fig. 10, fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 10, the electronic device 1000 includes a processor 1010, a memory 1020, and a bus 1030.
The memory 1020 stores machine-readable instructions executable by the processor 1010, when the electronic device 1000 runs, the processor 1010 and the memory 1020 communicate through the bus 1030, and when the machine-readable instructions are executed by the processor 1010, the steps of the method for controlling virtual roles in the method embodiments shown in fig. 1 to 5 may be executed.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method for controlling a virtual role in the method embodiments shown in fig. 1 to 5 may be executed.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the exemplary embodiments of the present application, and are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (13)

1. A control method of virtual characters is characterized in that a graphical user interface is provided through a terminal device, at least part of game scenes and target virtual characters are displayed in the graphical user interface, an input device is externally connected with the terminal device, and the control method comprises the following steps:
acquiring a first state of a reflection light spot corresponding to the input device in the current state of the input device, and controlling the target virtual character to face a first direction corresponding to the first state in the game scene;
determining a second state of the reflected light spot when the input device stops rotating in response to the rotation of the input device;
if the second state of the reflected light spot meets an orientation adjustment condition, determining a second direction corresponding to the second state in the game scene, and controlling the target virtual character to rotate from the first direction to the second direction; wherein the orientation adjustment condition includes a change in shape of the second state relative to the first state or a change in position of the second state relative to the first state.
2. The control method according to claim 1, wherein if the second state of the reflected light spot satisfies an orientation adjustment condition, determining a second direction in the game scene corresponding to the second state, and controlling the target virtual character to rotate from the first direction toward the second direction includes:
and when the shape of the second state is changed relative to the first state, controlling the target virtual character to rotate from the first direction to the second direction according to the change direction of the shape of the second state relative to the first state or the change of the light intensity of the second state relative to the first state.
3. The method according to claim 2, wherein when the orientation adjustment condition that the second state satisfies is that the direction of the second state of the reflected light spot changes with respect to the shape of the first state, and when the second state of the reflected light spot satisfies the orientation adjustment condition, determining a second direction in the game scene corresponding to the second state, and controlling the target avatar to rotate from the first direction toward the second direction, includes:
in response to a steering command, determining the second direction according to the shape offset direction and the shape offset distance of the second state relative to the first state;
and controlling the target virtual character to rotate towards the second direction.
4. The control method according to claim 3, wherein before the determining, in response to a steering instruction, the second direction in accordance with a shape shift direction and a shape shift distance of the second state with respect to the first state, the control method further comprises:
detecting whether the shape deviation angle of the second state relative to the first state is larger than a preset angle threshold value or not, and determining that the steering instruction of the input device is received when the shape deviation angle is larger than the preset angle threshold value.
5. The control method according to claim 3, wherein determining the second direction from a shape shift direction and a shape shift distance of the second state with respect to the first state in response to a steering command includes:
determining the rotation direction of the target virtual character according to the shape deviation direction;
determining the rotation angle of the target virtual character according to the shape offset distance;
determining the second direction based on the rotation direction and the rotation angle.
6. The control method according to claim 2, wherein when the orientation adjustment condition that the second state satisfies is that the light intensity of the second state of the reflection light spot changes relative to the first state, if the second state of the reflection light spot satisfies the orientation adjustment condition, determining a second direction in the game scene corresponding to the second state, and controlling the target virtual character to rotate from the first direction to the second direction, includes:
when the light intensity of the second state of the reflected light spot is weakened relative to the first state, determining that the direction opposite to the current direction of the target virtual character is the second direction;
and controlling the target virtual character to rotate towards the second direction.
7. The control method according to claim 2, wherein when the orientation adjustment condition is that the shape of the second state is changed with respect to the first state, the second direction of the target virtual character includes at least one of:
left of the target avatar, right of the target avatar, front of the target avatar, and back of the target avatar.
8. The control method according to claim 1, wherein if the second state of the reflected light spot satisfies an orientation adjustment condition, determining a second direction in the game scene corresponding to the second state, and controlling the target virtual character to rotate from the first direction toward the second direction includes:
when the position of the second state relative to the first state changes, determining the moving track of the reflected light spot according to the second position of the second state and the first position of the first state;
and determining a second direction based on the moving direction and the moving distance of the moving track, and controlling the target virtual character to rotate from the first direction to the second direction.
9. The control method according to claim 8, wherein the determining a second direction based on the movement direction and the movement distance of the movement trajectory and controlling the target virtual character to rotate from the first direction toward the second direction includes:
determining a direction of rotation of the target virtual character based on the direction of movement;
determining a rotation angle of the target virtual character based on the movement distance;
and determining the second direction based on the rotating direction and the rotating angle, and controlling the target virtual character to rotate from the first direction to the second direction.
10. The control method of claim 1, further comprising, while responding to rotation of the input device:
determining the movement track of the reflected light spot according to the obtained states of the reflected light spot;
and controlling the target virtual character to move according to the movement track.
11. A control device for virtual characters is characterized in that a graphical user interface is provided through a terminal device, at least part of game scenes and target virtual characters are displayed in the graphical user interface, an input device is externally connected with the terminal device, and the control device comprises:
the state acquisition module is used for acquiring a first state of a reflection light spot corresponding to the input device in the current state of the input device and controlling the target virtual character to face a first direction corresponding to the first state in the game scene;
a state determination module for determining a second state of the reflected light spot when the input device stops rotating in response to the rotation of the input device;
the orientation adjusting module is used for determining a second direction corresponding to the second state in the game scene if the second state of the reflected light spot meets an orientation adjusting condition, and controlling the target virtual character to rotate from the first direction to the second direction; wherein the orientation adjustment condition includes a change in shape of the second state relative to the first state or a change in position of the second state relative to the first state.
12. An electronic device, comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating via the bus when the electronic device is operating, the processor executing the machine-readable instructions to perform the steps of the method for controlling a virtual character according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that a computer program is stored thereon, which, when being executed by a processor, performs the steps of the method of controlling a virtual character according to any one of claims 1 to 10.
CN202110794314.3A 2021-07-14 2021-07-14 Virtual character control method and device, electronic equipment and readable storage medium Active CN113440841B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110794314.3A CN113440841B (en) 2021-07-14 2021-07-14 Virtual character control method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110794314.3A CN113440841B (en) 2021-07-14 2021-07-14 Virtual character control method and device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN113440841A true CN113440841A (en) 2021-09-28
CN113440841B CN113440841B (en) 2023-11-17

Family

ID=77816190

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110794314.3A Active CN113440841B (en) 2021-07-14 2021-07-14 Virtual character control method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN113440841B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6300936B1 (en) * 1997-11-14 2001-10-09 Immersion Corporation Force feedback system including multi-tasking graphical host environment and interface device
TW200625143A (en) * 2005-01-04 2006-07-16 Pixart Imaging Inc Personal computer's interactive input device and game-peripheral equipment
CN101896867A (en) * 2007-11-07 2010-11-24 豪威科技有限公司 Apparatus and method for tracking a light pointer
US20150094127A1 (en) * 2013-09-30 2015-04-02 Zynga Inc. Swipe-direction gesture control for video games using glass input devices
CN108543309A (en) * 2018-04-03 2018-09-18 网易(杭州)网络有限公司 The method, apparatus and terminal of the movement of virtual controlling object are controlled in augmented reality
US20190215372A1 (en) * 2016-12-22 2019-07-11 Tencent Technology (Shenzhen) Company Limited Scene switching method based on mobile terminal
AU2017421178A1 (en) * 2017-06-29 2020-02-13 Razer (Asia-Pacific) Pte. Ltd. Mouse button with replaceable lever mechanism
CN111124226A (en) * 2019-12-17 2020-05-08 网易(杭州)网络有限公司 Game screen display control method and device, electronic equipment and storage medium
CN111760269A (en) * 2020-07-08 2020-10-13 网易(杭州)网络有限公司 Information processing method and device and terminal equipment
CN112402976A (en) * 2020-11-24 2021-02-26 网易(杭州)网络有限公司 Game role control method, terminal, readable storage medium and electronic device
CN113082712A (en) * 2021-03-30 2021-07-09 网易(杭州)网络有限公司 Control method and device of virtual role, computer equipment and storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6300936B1 (en) * 1997-11-14 2001-10-09 Immersion Corporation Force feedback system including multi-tasking graphical host environment and interface device
TW200625143A (en) * 2005-01-04 2006-07-16 Pixart Imaging Inc Personal computer's interactive input device and game-peripheral equipment
CN101896867A (en) * 2007-11-07 2010-11-24 豪威科技有限公司 Apparatus and method for tracking a light pointer
US20150094127A1 (en) * 2013-09-30 2015-04-02 Zynga Inc. Swipe-direction gesture control for video games using glass input devices
US20190215372A1 (en) * 2016-12-22 2019-07-11 Tencent Technology (Shenzhen) Company Limited Scene switching method based on mobile terminal
AU2017421178A1 (en) * 2017-06-29 2020-02-13 Razer (Asia-Pacific) Pte. Ltd. Mouse button with replaceable lever mechanism
CN108543309A (en) * 2018-04-03 2018-09-18 网易(杭州)网络有限公司 The method, apparatus and terminal of the movement of virtual controlling object are controlled in augmented reality
CN111124226A (en) * 2019-12-17 2020-05-08 网易(杭州)网络有限公司 Game screen display control method and device, electronic equipment and storage medium
CN111760269A (en) * 2020-07-08 2020-10-13 网易(杭州)网络有限公司 Information processing method and device and terminal equipment
CN112402976A (en) * 2020-11-24 2021-02-26 网易(杭州)网络有限公司 Game role control method, terminal, readable storage medium and electronic device
CN113082712A (en) * 2021-03-30 2021-07-09 网易(杭州)网络有限公司 Control method and device of virtual role, computer equipment and storage medium

Also Published As

Publication number Publication date
CN113440841B (en) 2023-11-17

Similar Documents

Publication Publication Date Title
CN111124226B (en) Game screen display control method and device, electronic equipment and storage medium
JP6722252B2 (en) Information processing method and apparatus, storage medium, electronic device
CN107648847B (en) Information processing method and device, storage medium and electronic equipment
JP2022521324A (en) Game character control methods, devices, equipment and storage media
EP3524328B1 (en) Image rendering responsive to user actions in head mounted display
EP1595584B1 (en) Image processing program, game information processing program and game information processing apparatus
JP2020504851A (en) Game screen display control method, device, storage medium, and electronic device
CN108404407B (en) Auxiliary aiming method and device in shooting game, electronic equipment and storage medium
CN108854063B (en) Aiming method and device in shooting game, electronic equipment and storage medium
US11117052B2 (en) Game device, control method of game device, and storage medium that can be read by computer
CN111888766A (en) Information processing method and device in game, electronic equipment and storage medium
JP5252879B2 (en) Operation control device and program for realizing the operation control device
CN110652725A (en) Method and device for controlling aiming direction in game, electronic equipment and storage medium
JP2019136358A (en) Game system and program
JP2007135823A (en) Shooting type game machine
CN112870701B (en) Virtual character control method and device
JP2001232056A (en) Video game device, image expression method, program control method and storage medium
US20210117070A1 (en) Computer-readable recording medium, computer apparatus, and method of controlling
CN111494940B (en) Display control method and device for virtual object in game
WO2024001191A1 (en) Operation method and apparatus in game, nonvolatile storage medium, and electronic apparatus
CN113198177A (en) Game control display method and device, computer storage medium and electronic equipment
CN113440841B (en) Virtual character control method and device, electronic equipment and readable storage medium
CN111957042A (en) Control method and device of game lens
JP5205757B2 (en) GAME PROGRAM AND GAME DEVICE
CN113262473A (en) Interactive control method and device in game, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant