CN113440841B - Virtual character control method and device, electronic equipment and readable storage medium - Google Patents

Virtual character control method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN113440841B
CN113440841B CN202110794314.3A CN202110794314A CN113440841B CN 113440841 B CN113440841 B CN 113440841B CN 202110794314 A CN202110794314 A CN 202110794314A CN 113440841 B CN113440841 B CN 113440841B
Authority
CN
China
Prior art keywords
state
virtual character
light spot
target virtual
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.)
Active
Application number
CN202110794314.3A
Other languages
Chinese (zh)
Other versions
CN113440841A (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

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application provides a virtual character control method, a virtual character control device, electronic equipment and a readable storage medium, wherein the virtual character control method comprises the following steps: acquiring a first state of a reflection light spot corresponding to the input device in a 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 rotation of the input device; and if the second state of the reflection light spot meets the direction adjustment condition, determining a second direction corresponding to the second state, and controlling the target virtual character to rotate towards the second direction. According to the direction adjustment method and device for the target virtual character, the second direction corresponding to the second state is determined according to the direction adjustment condition met by the second state of the reflective light spot after the input device rotates, and then the target virtual character is controlled to rotate towards the second direction, so that the direction adjustment time of the target virtual character is saved, and the direction adjustment efficiency and the man-machine interaction efficiency are improved.

Description

Virtual character control method and device, 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 apparatus for controlling a virtual character, an electronic device, and a readable storage medium.
Background
With the continuous development of science and technology, 3D (3 Dimensions) games using spatial stereo computing technology to realize operation are developed to a great extent due to the advantages of strong visual effect, excellent substitution feeling and the like, such as a large escape and kill type shooting game-a chicken eating game, which is widely loved and accepted by players due to the civilian nature of the game, the high creativity, openness, derivatization, playability, interactivity, ornamental value and the like of the game, and the chicken eating game at the present stage is divided into a hand game version and an end game version due to the different carrying terminals, and the different versions also have certain difference in control mode of virtual characters in the game.
In order to better complete a task or travel in a game, the virtual character needs to be controlled to move towards a specific direction, and in the end stream, the rotation of the virtual character in a scene is controlled through the sliding operation of an input device connected with a terminal device at the present stage, 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 bottom reflection light spots of the input device in the moving process are generated and sent to a terminal, and the terminal needs to analyze a plurality of tracks generated by the reflection light spots so as to determine the rotation direction of the virtual character.
Disclosure of Invention
Accordingly, an object of the present application is to provide a method, an apparatus, an electronic device, and a readable storage medium for controlling a virtual character, which directly determine a second direction corresponding to a second state, which the virtual character needs to face, according to a direction adjustment condition satisfied by the second state of a reflected light spot after rotation of an input device, and further control a target virtual character to rotate in the second direction, thereby saving a time for adjusting the direction of the target virtual character, and contributing to improving a direction adjustment efficiency and a man-machine interaction efficiency.
In a first aspect, an embodiment of the present application provides a method for controlling a virtual character, where a graphical user interface is provided by a terminal device, where at least a part of a game scene and a target virtual character are displayed in the graphical user interface, and the terminal device is externally connected with an input device, where the method includes:
acquiring a first state of a reflection light spot corresponding to the input device in a 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 rotation of the input device;
if the second state of the reflection light spot meets the direction 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 one possible implementation manner, 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 includes:
and when the shape of the second state relative to the first state is changed, 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 implementation manner, when the second state satisfies the direction adjustment condition that the second state of the reflected light spot changes relative to the direction of the shape of the first state, determining a second direction corresponding to the second state in the game scene if the second state of the reflected light spot satisfies the direction adjustment condition, and controlling the target virtual character to rotate from the first direction to the second direction, including:
in response to a steering instruction, determining the second direction according to a shape offset direction and a 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 shift direction and the shape shift 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, and determining that a steering instruction of the input device is received when the shape deviation angle is determined to be larger than the preset angle threshold.
In one possible embodiment, in response to a steering instruction, determining the second direction according to a shape offset direction and a shape offset distance of the second state relative to the first state 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;
the second direction is determined based on the rotation direction and the rotation angle.
In one possible implementation manner, when the second state satisfies the direction adjustment condition that the second state of the reflected light spot changes relative to the light intensity of the first state, determining a second direction corresponding to the second state in the game scene if the second state of the reflected light spot satisfies the direction adjustment condition, and controlling the target virtual character to rotate from the first direction to the second direction, including:
when the light intensity of the second state of the reflection light spot is reduced relative to the first state, 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 one possible embodiment, when the orientation adjustment condition is that the shape of the second state changes relative to the first state, the second direction of the target avatar includes at least one of:
to the left of the target avatar, to the right of the target avatar, to the front of the target avatar, and to the rear of the target avatar.
In one possible implementation manner, 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 includes:
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;
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 one possible implementation manner, the 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 toward the second direction, includes:
determining a rotation direction of the target virtual character based on the movement direction;
determining a rotation angle of the target virtual character based on the movement distance;
and determining the second direction based on the rotation direction and the rotation angle, and controlling the target virtual character to rotate from the first direction towards the second direction.
In one possible embodiment, the control method further includes, while responding to the rotation of the input device:
determining a moving track of the reflection light spot according to the acquired states of the reflection light spot;
and controlling the target virtual character to move according to the moving track.
In a second aspect, an embodiment of the present application further provides a control device for a virtual character, where a graphical user interface is provided through a terminal device, where at least a part of a game scene and a target virtual character are displayed in the graphical user interface, and the terminal device is externally connected with an input device, where 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 determining module for determining a second state of the reflected light spot when the input device stops rotating in response to rotation of the input device;
the direction adjusting module is used for 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 reflection light spot meets the direction adjusting condition; 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, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating over the bus when the electronic device is running, the processor executing the machine-readable instructions to perform the steps of the method of controlling a virtual character as claimed in any one of the first aspects.
In a fourth aspect, embodiments of the present application also provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method for controlling a virtual character according to any of the first aspects.
According to the virtual character control method, the device, the electronic equipment and the readable storage medium, the first state of the reflection light spot corresponding to 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 second state of the reflection light spot is determined when the input device stops rotating in response to rotation of the input device, the second direction corresponding to the second state is determined according to the direction adjustment condition met by the second state, and further rotation of the target virtual character from the first direction to the second direction is controlled. According to the method and the device, according to the change of the states which are met by the reflection light spots corresponding to the analysis input device, the second direction which is required to be oriented by the virtual character and corresponds to the second state is directly determined according to the orientation adjustment conditions which are met by the second state of the reflection light spots after the input device rotates, so that the target virtual character is controlled to rotate towards the second direction, the adjustment time of the orientation of the target virtual character is saved, and the direction adjustment efficiency and the man-machine interaction efficiency are improved.
In order to make the above 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 needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
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 method for controlling a virtual character according to an embodiment of the present application;
FIG. 3 is a flowchart of another method for controlling virtual roles according to an embodiment of the present application;
fig. 4 is a flowchart of another method for controlling a virtual character according to an embodiment of the present application;
FIG. 5 is a flowchart of another method for controlling virtual roles according to an embodiment of the present application;
FIG. 6 is one of the graphical interface scene diagrams;
FIG. 7 is a second graphical interface scene;
fig. 8 is a schematic structural diagram of a virtual character control device according to an embodiment of the present application;
FIG. 9 is a second schematic diagram of a virtual character control device 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
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. Based on the embodiments of the present application, every other embodiment obtained by a person skilled in the art without making any inventive effort falls within the scope of protection of the present application.
It should be noted that the term "comprising" will be used in embodiments of the application to indicate the presence of the features stated hereafter, but not to exclude the addition of other features.
With the continuous development of science and technology, 3D (3 Dimensions) games using spatial stereo computing technology to realize operation are developed to a great extent due to the advantages of strong visual effect, excellent substitution feeling and the like, such as a large escape and kill type shooting game-a chicken eating game, which is widely loved and accepted by players due to the civilian nature of the game, the high creativity, openness, derivatization, playability, interactivity, ornamental value and the like of the game, and the chicken eating game at the present stage is divided into a hand game version and an end game version due to the different carrying terminals, and the different versions also have certain difference in control mode of virtual characters in the game.
In order to better complete a task or travel in a game, the virtual character needs to be controlled to move towards a specific direction, and in the end stream, the rotation of the virtual character in a scene is controlled through the sliding operation of an input device connected with a terminal device at the present stage, 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 bottom reflection light spots of the input device in the moving process are generated and sent to a terminal, and the terminal needs to analyze a plurality of tracks generated by the reflection light spots so as to determine the rotation direction of the virtual character.
The application aims to provide a control method of a virtual character, which is used for saving the adjustment time of the direction of a target virtual character and improving the direction adjustment efficiency and the man-machine interaction efficiency.
In order to facilitate 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, such as games of the type of transmission frames per second (Frames Per Second, FPS) or games of the type of massive multi-person online (Massive Multiplayer Online, MMO); it should be noted that the embodiments of the present application are not limited to the above-described types of games, and are not limited to the field of games.
The virtual character control method in the embodiment of the application can be operated in the terminal equipment or the server. The terminal device may be a local terminal device (such as a local touch terminal). When the control method of the virtual character is operated on the server, the virtual character may be a cloud game.
In an alternative embodiment, cloud gaming refers to a game style based on cloud computing. In the running mode of the cloud game, the running main body of the game program and the game picture presentation main body are separated, the storage and running of the information display method are completed on a cloud game server, and a cloud game client is used for receiving and sending data and presenting game pictures, for example, the cloud game client can be a display device with a data transmission function, such as a mobile terminal, a television, a computer, a palm computer and the like, which is close to a user side; the terminal device for information prompt is a cloud game server in the cloud. When playing the game, the 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, codes and compresses data such as game pictures and the like, returns the data to the cloud game client through a network, and finally decodes the data through the cloud game client 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 game pictures. The local terminal device is used for interacting with a user through a graphical user interface, namely, conventionally downloading and installing a game program through the electronic device and running the game program. The manner in which the local terminal device provides the graphical user interface to the user may include a variety of ways, for example, may be rendered for display on a display screen of the local terminal device, or may be 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 game visuals, and a processor for running the game, generating the graphical user interface, and controlling the display of the graphical user interface on the display screen.
The virtual character control method provided by the embodiment of the application can be operated in the aforementioned local terminal equipment or the aforementioned cloud game client. The following description will take an example in which the above-described virtual character control method is executed in a local terminal device (hereinafter referred to as a terminal device).
Referring to fig. 1, fig. 1 is a flowchart of a method for controlling a virtual character according to an embodiment of the present application. As shown in fig. 1, the method for controlling a virtual character according to the embodiment of the present application includes:
s101, acquiring a first state of a reflection light spot corresponding to the input device in a 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;
s102, responding to rotation of the input device, and determining a second state of the reflection light spot when the input device stops rotating;
and S103, if the second state of the reflection light spot meets the direction 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 for the virtual character, provided by the embodiment of the application, according to the change of the state which is met by the reflection light spot corresponding to the analysis input device, the second direction which is required to be oriented by the virtual character and corresponds to the second state is directly determined according to the orientation adjustment condition which is met by the second state of the reflection light spot after the rotation of the input device, so that the rotation of the target virtual character towards the second direction is controlled, the adjustment time of the orientation of the target virtual character is saved, and the improvement of the orientation adjustment efficiency and the man-machine interaction efficiency is facilitated.
Exemplary steps of embodiments of the present application are described below:
s101, acquiring a first state of a reflection light spot corresponding to the input device in a 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.
In the embodiment of the application, a first state of a reflection light spot reflected by light at the bottom of the input device is obtained under the current state of the input device, and a first direction of a target virtual character corresponding to the first state 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, in which a light emitting diode is disposed inside the optical mouse, and light emitted by the light emitting diode can illuminate the bottom surface of the optical mouse, so as to generate a reflected light spot, and a part of light reflected by the bottom surface of the optical mouse passes through a set of optical lenses and is transmitted to a light sensing device (microimager) to be imaged. When the optical mouse moves, the moving track is recorded as a group of high-speed shot coherent images, and is analyzed and processed by a special image analysis chip (DSP, digital microprocessor) in the optical mouse, the moving direction and the moving distance of the mouse are judged according to the moving track formed by a plurality of reflection light spots, the cursor positioning in a game scene is completed, and then the movement of a target virtual character in the game is controlled according to the moving direction and the moving distance of the cursor.
Here, the first state of the reflected light spot corresponding to the input device includes the shape of the reflected light spot and the position of the reflected light spot relative 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 leftwards, the input device is inclined rightwards, and the input device is lifted, and 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 right offset shape, the reflection light spot is in a left offset shape, and the light intensity of the reflection light spot is weakened.
Here, the mapping relationship between the first state of the reflected light spot and the first direction may be set in advance in the game setting, or may be that the first state of the reflected light spot corresponds to the first direction, for example, it is determined that the shape of the reflected light spot is shifted to the right, it is determined that the current state of the input device is shifted to the left, and at this time, the first direction is also the left direction, and at this time, the target virtual character is oriented to the left in the game scene.
It should be noted that, when the current state of the input device is normally set, that is, the first state of the corresponding reflected light spot is the position of the reflected light spot at the right center with respect to the input device, and the reflected light spot shape is the normal unbiased shape, the direction of the target avatar is forward (toward the right front of the target avatar).
S102, responding to rotation of the input device, and determining a second state of the reflection light spot when the input device stops rotating.
In an embodiment of the application, in response to the input device being turned by the player, a second state of the corresponding reflected light spot is determined when the input device stops turning.
Here, the rotation for the input device may be tilting the input device to the left and right (moving along the X-axis of the plane of the input device); the operation of lifting the input device (movement along the Y axis of the plane of the input device) may be performed.
Here, the judgment for stopping the movement of the input device during the rotation may be that after receiving one reflected light spot, the reflected light spot at a different position is not received within a preset interval period, and it is determined that the input device stops rotating, or that the player lifts the input device (the light of the received reflected light spot is obviously weakened) when controlling the input device, and after the preset interval period, the input device is not changed, where the input device is considered to stop rotating, or that the state of the reflected light spot corresponding to the input device is not changed any more within the preset interval period, and then the input device is considered to stop rotating.
Here, the second state of the reflected light spot is consistent with the first state, and also includes the shape of the reflected light spot and the position of the reflected light spot relative to the input device, and the correspondence between the second state of the input device and the second state of the reflected light spot is consistent with the correspondence between the current state of the input device and the first state of the reflected light spot, which is not described again.
And S103, if the second state of the reflection light spot meets the direction 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 reflection light spot meets the preset direction adjustment condition, determining a second direction corresponding to the second state of the reflection light spot in the game scene, and simultaneously controlling the target virtual character to rotate from the first direction to the second direction.
Here, the direction adjustment condition is that the second direction of the target virtual character includes at least one of the following when the shape of the second state is changed with respect to the first state: to the left of the target avatar, to the right of the target avatar, to the front of the target avatar, and to the rear of the target avatar.
Here, the orientation adjustment condition includes that the second state changes in shape with respect to the first state, or that the second state changes in position with respect to the first state, that is, the second state and the first state are necessarily different, may have different shapes, may have different positions, or may have different shapes and positions.
Here, in the embodiment of the present application, a manner is provided that the direction of the target virtual character does not need to be changed according to the track formed by the reflection light spot corresponding to the input device, and the target virtual character can be controlled to rotate towards the target direction in the game scene to a certain extent according to the state change situation of one reflection light spot.
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 different, which are respectively described below:
first, when the second state of the reflected light spot satisfies the orientation adjustment condition, the second state changes in shape relative to the first state:
The step of "when the second state satisfies the direction adjustment condition that the second state of the reflected light spot changes relative to the direction of the shape of the first state, determining a second direction corresponding to the second state in the game scene and controlling the target avatar to rotate from the first direction toward the second direction if the second state of the reflected light spot satisfies the direction adjustment condition" includes:
and when the shape of the second state relative to the first state is changed, 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 relative to the first state changes, 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, a second direction in which the target virtual character is required to turn is determined, and then the target virtual character is controlled to turn towards the second direction.
Here, the change in the shape of the second state with respect to the first state includes a direction of 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.
The reason why the direction of the shape of the second state is changed (shifted) with respect to 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 with respect to the first state, it is determined that the player tilts the mouse to the right, and if the second state is shifted to the right with respect to the first state, it is determined that the player tilts the mouse to the left.
The change of the light intensity of the second state relative to the first state is caused by that the player lifts or drops the input device when controlling the input device, specifically, if the light intensity of the second state relative to the first state is weakened, the player is determined to lift the input device.
Here, a corresponding relation 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 game setting, and a second direction in which the target virtual character needs to turn is determined according to that the obtained second state of the reflection light spot meets the direction adjustment condition, so that the target virtual character is controlled to rotate in the second direction in a game scene.
Here, the change of the shape of the second state with respect to the first state includes two different changes, that is, the change direction of the shape of the second state with respect to the first state and the change of the light intensity of the second state with respect to the first state, and there is a difference in the manner of controlling the target virtual character to rotate from the first direction to the second direction for the different changes, which will be described below:
(1) When the second state satisfies an orientation adjustment condition that a direction of the second state of the reflected light spot changes with respect to a shape of the first state:
referring to fig. 2, fig. 2 is a flowchart of another virtual character control method according to an embodiment of the application. As shown in fig. 2, in the method for controlling a virtual character according to the embodiment of the present application, if a second state of the reflected light spot satisfies 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 includes:
s201, responding to a steering instruction, 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 the rotation instruction, a second direction in which the target virtual character is required to be controlled to turn is correspondingly determined according to the shape offset direction and the shape offset distance of the second state relative to the first state.
Here, as for the shape shift direction and the shape shift distance of the second state with respect to the first state, the second direction can be determined in two ways:
mode one: and determining the second direction according to the shape offset direction of the second state relative to the first state.
In the embodiment of the application, according to the shape offset direction of the second state of the reflection light spot of the input device relative to the first state, a second direction which corresponds to the shape offset direction and is required to control the direction of the target virtual character is determined.
Here, the shape shift direction of the second state of the reflected light spot at the bottom of the input device with respect to the first state is caused by the fact that the player tilts the input device when operating the input device, and at this time, the shape shift direction of the second state of the reflected light spot with respect to the first state also corresponds to the tilt direction of the player with respect to the input device, and the second direction is determined according to the tilt direction of the input device.
Since the tilting 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 convenience of operation of the player, and the shape shift direction of the second state of the reflective light spot at the bottom of the input device relative to the first state is also classified into a case of shifting to the left and a case of shifting to the right, accordingly, when the second direction in which the target virtual character needs to be turned according to the shape shift direction of the second state of the reflective light spot relative to the first state is determined, there are two target directions, that is, turning to the right (turning to the right by 90 °) and turning to the left (turning to the left by 90 °) of the target virtual character.
And in a second mode, 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 virtual character control method according to an embodiment of the application. As shown in fig. 3, in the method for controlling a virtual character according to the embodiment of the present application, in response to a steering instruction, the step of determining the second direction according to a shape offset direction and a shape offset distance of the second state relative 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 rotation direction and the rotation angle.
In the embodiment of the application, the direction in which the target virtual character needs to rotate is determined according to the acquired shape offset direction of the second state of the reflection light spot at the bottom of the input device relative to the first state. And determining a rotation angle of the target virtual character 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 of the target virtual character to be rotated according to the determined rotation direction and rotation angle.
Here, the rotation direction of the target virtual character determined according to the shape offset direction of the second state of the reflective light spot at the bottom of the input device relative to the first state is consistent with the above manner of determining the target direction according to the shape offset direction of the second state of the reflective light spot relative to the first state, which is not described herein.
Here, the direction of rotation of the target virtual character is determined only roughly according to the direction of shape deviation of the second state of the reflected light spot at the bottom of the input device relative to the first state, and there may be a direct rotation to the left of the target virtual character or a direct rotation to the right of the target virtual character, so in order to more accurately determine the second direction in which the target virtual character needs to rotate, a specific rotation angle may also be determined according to the distance of shape deviation of the second state of the reflected light spot at the bottom of the input device relative to the first state.
Here, the correspondence between the shape shift distance of the second state of the reflected light spot with respect to the first state and the rotation angle at which the target virtual character needs to be rotated may be set in advance at the time of game setting.
Here, the directions corresponding to the different shape offset distances may be preset, and the distances that the reflected light spots may be offset may be divided into a plurality of distance sections, where each distance section corresponds to a rotation angle of the target virtual character.
The distance interval division can be that the distance from which the reflection light spot can deviate is equidistantly divided for determination, or the requirement of the player for controlling the target virtual character is determined according to the historical operation information of the player, and the distance interval corresponding to the rotation angle of the player for controlling the target virtual character is properly enlarged; the determination may be performed according to game progress information in the current game scene, for example, a distance zone corresponding to a direction in which the target virtual character exists in a special area (replenishment area), a direction in which the enemy character exists, and a direction in which the teammate character exists may be increased appropriately.
Here, after the rotation direction and the rotation angle are determined, the control target virtual character is rotated toward the rotation direction by the corresponding rotation angle.
Here, with the scheme of controlling the rotation of the target avatar in the second direction according to the shape shift direction and the shape shift distance of the second state of the reflected light spot of the input device with respect to the first state, the rotation range is from the forward right rotation (90 ° to the right) to the forward left rotation (90 ° to the left) and is a gradual process in the course of the leftward or rightward rotation, for example, the target avatar is controlled to be rotated 45 ° to the right and then the target avatar is controlled to be rotated 90 ° to the right, and the rotation reaches the forward right direction of the target avatar.
When the second direction of the target virtual character is determined according to the shape offset direction and the shape offset distance of the second state of the reflected light 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 reflected light spot at the bottom of the input device may fail to be captured, so that the target virtual character cannot be controlled, that is, the offset distance of the reflected light spot is relatively small, therefore, in the setting process of the corresponding rotation angle of the distance, the rotation angle is not finely divided any more, and the rotation angle can be divided into angles captured well, such as 0 °, 45 °, 90 ° or 0 °, 30 °, 60 °, 90 °, so as to complete the control of the rotation of the target virtual character.
In one possible embodiment, before step "in response to a steering instruction, determining the second direction according to a shape offset direction and a shape offset distance of the second state with respect to the first state", 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, and determining that a steering instruction of the input device is received when the shape deviation angle is determined to be larger than the preset angle threshold.
In the embodiment of the application, according to whether the received shape deviation angle of the second state relative to the first state is larger than the preset angle threshold, when the shape deviation angle is larger than the preset threshold, the change of the shape of the second state relative to the first state of the captured reflected light spot of the input device is determined to be effective, namely an effective rotation instruction is received.
Here, the preset angle threshold is set to prevent the misoperation of the player when controlling the input device from triggering the target virtual character to turn, which affects the normal game progress.
The preset angle threshold value can be determined according to deviation data of a plurality of historical reflection light spot positions obtained by operating the input device by a player, and the deviation angle of the shape of the reflection light spot, which is smaller than or equal to the preset angle threshold value, is regarded as the operation of not triggering the remembering rotation of the virtual character of the control target, so that the change of the reflection light spot at the bottom of the input device is ignored, and misoperation is prevented.
Here, when the operation that the reflected light spot at the bottom of the input device is offset is continuously received in a period of time, the operation is also considered to be the control operation that the player wants to trigger the control target virtual character to turn, at this time, a prompt message may be displayed on the graphical user interface to prompt the player to increase the inclination angle of the input device, so that the terminal obtains the reflected light spot with the shape offset angle greater than the preset angle threshold value, so as to trigger the control target virtual character to turn. Displaying the prompt on the graphical user interface may be to prompt the player to increase the instruction to tilt the input device, for example: 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 in a period of time, the inquiry information may also be directly displayed on the graphical user interface, and whether to start the operation of turning the control target virtual character is determined according to the area where the player operates the input device to click on the graphical user interface.
For example, the information "whether the control character rotates" is displayed on the graphical user interface, and two click areas of yes and no are provided, and when it is determined that a click operation is accepted at the click area of yes, a steering instruction for steering the control target virtual character is triggered.
S202, controlling the target virtual character to rotate towards the second direction.
In the embodiment of the application, the target virtual character is controlled to rotate from the initial first direction to the determined second direction according to the determined second direction.
(2) When the second state meets the direction adjustment condition that the light intensity of the second state of the reflection light spot relative to the first state changes:
and if the second state of the reflected light spot meets the direction 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 step comprises the following steps:
and when the light intensity of the second state of the reflection light spot is determined to be weakened relative to the light intensity of the first state, 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 reflection light spot relative to the first state is detected to be weakened, 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 the decrease in the light intensity of the reflected light spot is detected, it may be determined that the player lifts the input device, and at this time, the target virtual character may be directly controlled to be directed in the second direction determined to be opposite to the current direction, and further the target virtual character may be controlled to be turned in the second direction opposite to the current direction.
Second, when the second state of the reflected light spot satisfies the orientation adjustment condition, the position of the second state relative to the first state changes:
referring to fig. 4, fig. 4 is a flowchart of another virtual character control method according to an embodiment of the present application. As shown in fig. 4, in the method for controlling a virtual character according to the embodiment of the present application, if a second state of the reflected light spot satisfies 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 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 the embodiment of the application, when the second state of the reflection light spot meets the direction adjustment condition that the position of the second state relative to the first state changes, the moving 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 track 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 determination of the movement direction and the movement distance may be to determine a line segment with the first position as a start point and the second position as an end point, determine 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 determine the length of the line segment as the movement distance.
And 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 toward the second direction.
Here, the second direction is determined according to the moving direction and the moving distance of the moving trajectory, and can be also classified into the following three modes:
mode one: and determining a second direction according to the moving direction of the moving track.
In the embodiment of the application, the corresponding relation between the moving direction and the second direction of the moving track aiming at different reflection light spots can be preset, and after the moving direction of the moving track is determined, the second direction is determined according to the moving direction.
Here, 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, the moving direction of the reflection light spot indicated by the moving track is directly determined, and then the corresponding second direction is directly determined.
For example, if the second position of the second state of the reflected light spot is determined to be on the left side of the first position of the first state of the reflected light spot, that is, the moving direction of the moving track is left, then the corresponding second direction may be determined to be the left direction.
Mode two: 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 can be preset, the moving distance corresponding to the moving track is divided into a plurality of distance sections, and each distance section corresponds to a second direction.
For example, the movement distance (20 cm) corresponding to the movement track may be divided into four sections, wherein the second direction corresponding to 0-5cm is the rightward direction, the second direction corresponding to 6-10cm is the backward direction, the second direction corresponding to 10-15cm is the leftward direction, and the second direction corresponding to 15-20cm is the forward direction, and when it is determined that the movement distance corresponding to the current movement track is 7cm and within the distance range of 6-10cm, the second direction is the backward direction.
The division of the distance intervals and the corresponding second direction of each distance interval are preset in the game setting process. The determination may be performed by equally dividing the movement distance corresponding to the movement track, or determining the steering requirement for the player according to the historical operation information of the player, and appropriately enlarging the distance interval corresponding to the direction in which the player frequently steers, or determining 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 according to the game progress information in the current game scene, for example.
And thirdly, determining a second direction according to the moving direction and the moving distance.
In the present application, the step of 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 toward the second direction includes: determining a rotation direction of the target virtual character based on the movement direction; determining a rotation angle of the target virtual character based on the movement distance; and determining the second direction based on the rotation direction and the rotation angle, and controlling the target virtual character to rotate from the first direction towards the second direction.
In the embodiment of the present application, the manner of determining the second direction according to the moving direction and the moving distance is consistent with the manner of determining the second direction according to the moving direction and the moving distance when the direction adjustment condition satisfied by the second state is that the direction of the second state of the reflected light spot relative to the shape of the first state changes, which is not described herein.
In the embodiment of the present application, in the adjustment process of determining the second direction and rotating the target virtual character from the first direction to the second direction, the adjustment manner according to the shape change of the second state relative to the first state and the adjustment manner according to the position change of the second state relative to the first state may be to adjust the target virtual character alone or to adjust the direction of the target virtual character in a complementary manner.
Taking an example of a combination of an adjustment mode according to the change of the shape of the second state relative to the first state and an adjustment mode according to the change of the position of the second state relative to the first state, according to the second state of the reflective light spot corresponding to the input device relative to the first state of the reflective light spot, it is found that the shape of the reflective light spot is shifted to the right in the second state relative to the reflective light spot in the first state, at this time, it is determined that the target virtual character needs to be controlled to rotate to the left, and then it is determined that the target virtual character needs to rotate by 30 ° according to the movement distance between the second position indicated in the second state of the reflective light spot and the first position of the first state, and then the second direction determined by combining is rotated to the left by 30 °.
Referring to fig. 5, fig. 5 is a flowchart of another virtual character control method according to an embodiment of the present application. As shown in fig. 5, in one possible real-time manner, the control method for a virtual character according to the embodiment of the present application further includes, while responding to a rotation of an input device:
s501, determining the moving track of the reflection light spot according to the acquired states of the reflection light spot.
S502, controlling the target virtual character to move according to the moving track.
In the embodiment of the application, the target virtual character is controlled to move in the game scene according to the moving direction and the moving distance corresponding to the moving track according to the moving track formed by the received multiple states of the reflecting light spots at the bottom of the input device.
Here, when the control avatar rotates, the control avatar may rotate in place with respect to the target avatar, and the movement of the control avatar may be determined by forming a movement track according to a plurality of states of the reflected light spot of the input device, so that the control avatar may also control the target avatar to move while rotating.
Here, when the control target virtual character moves in the game scene, a plurality of states of the continuous reflection light spot are required to be acquired, and the plurality of states of the reflection light spot during the movement of the input device at a time.
Wherein the plurality of states of the reflected light spot for the primary input device may be a plurality of states of the received reflected light spot according to the bottom of the input device within a preset period of time; or a plurality of states of the reflected light spot before the input device stops moving in the continuous moving process; the plurality of states of the reflected light spot within the preset range may be also used, and the reflected light spot within the preset range is regarded as an ineffective reflected light spot.
The determination for stopping movement of the input device during continuous movement may be that after receiving a reflected light spot, after receiving no reflected light spot at a different position within a preset interval period, it is determined that the input device stops moving, or that the player lifts the input device (the light of the received reflected light spot is obviously weakened) while controlling the input device, where 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 moving direction and the moving distance of the input device may be determined according to the received moving track of the reflected light spot of the input device in the moving process, and the moving direction and the moving distance of the target virtual character in the game scene may be determined according to the corresponding relationship between the movement of the corresponding input device and the movement of the target virtual character, so as to control the movement of the target virtual character in the game scene.
The mapping relationship between the moving distance of the input device and the moving 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 correspondence between the movement distance of the target virtual character in the game scene and the movement distance of the input device may be a correspondence between a distance section and a distance section, for example, the movement distance section of the input device may be 0 to 5cm, and the movement distance section of the corresponding target virtual character in the game scene may be 0 to 10km (game distance).
Here, the determining of the movement direction of the input device may determine a direction and an angle of a movement track formed by a plurality of states of the reflection light spot in the movement process of the input device, with a position of the bottom reflection light spot when the input device does not start to move as an origin, so as to determine the movement direction of the input device, where the movement direction is also a movement direction of the target virtual character in the game scene.
The movement direction of the target virtual character may include a rotation direction and a rotation angle, for example, the target virtual character is controlled to rotate 30 ° to the right.
In one possible implementation manner, after the step of determining the 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 meets the orientation adjustment condition, 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 application, after the direction of the target virtual character is adjusted, the first game picture corresponding to the first direction of the graphical user interface is required to be switched to the second game picture corresponding to the second direction.
Here, the switching of the first game screen to the second game screen may be a gradual progress, and as the target virtual character rotates, the game screen in the direction toward which the target virtual character is oriented at each moment is presented in real time; the method may further include a direct switching process of directly switching the graphical user interface from the first game screen corresponding to the first direction to the second game screen corresponding to the second direction after turning the target virtual character to the second direction.
The following will specifically describe a process of adjusting the orientation of a character in a game scene by a mouse with reference to fig. 6 and 7, and fig. 6 is one of graphical interface scene diagrams; FIG. 7 is a second graphical interface scene, as shown in FIG. 6 and FIG. 7, in which the character orientation in the game scene is adjusted as follows:
step 1: at the beginning of the game, as shown in fig. 6, the current state of the mouse 610 is a normal placement state, the reflective light spot 620 corresponding to the mouse 610 is in a normal state, that is, the reflective light spot 620 is in a normal non-offset shape at the right center position relative to the input device, the target virtual character 631 located in the graphical user interface 630 is determined to be oriented in a forward direction, and the tree 632 directly 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 is determined when the mouse 610 stops rotating, and as shown in fig. 7, the state of the reflected light spot 620 is that the shape is shifted to the left, it is known that the player tilts the mouse 610 to the right at this time, and then the target virtual character 631 located in the graphical user interface 630 is controlled to rotate to the right, and the house 633 to the left of the target virtual character is displayed in the graphical user interface 630.
According to the control method for 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 second state of the reflection light spot is determined when the input device stops rotating in response to rotation of the input device, the second direction corresponding to the second state is determined according to the direction adjustment condition met by the second state, and rotation of the target virtual character from the first direction to the second direction is further controlled. According to the method and the device, according to the change of the states which are met by the reflection light spots corresponding to the analysis input device, the second direction which is required to be oriented by the virtual character and corresponds to the second state is directly determined according to the orientation adjustment conditions which are met by the second state of the reflection light spots after the input device rotates, so that the target virtual character is controlled to rotate towards the second direction, the adjustment time of the orientation of the target virtual character is saved, and the direction adjustment efficiency and the man-machine interaction efficiency are improved.
Based on the same inventive concept, the embodiment of the present application further provides a virtual character control device corresponding to the virtual character control method, and since the principle of solving the problem by the device in the embodiment of the present application is similar to that of the control method in the embodiment of the present application, the implementation of the device may refer to the implementation of the method, and the repetition is omitted.
Referring to fig. 8 and 9, fig. 8 is a schematic diagram of a virtual character control device according to an embodiment of the present application, and fig. 9 is a schematic diagram of a virtual character control device according to an embodiment of the present application. As shown in fig. 8, the control device 800 includes:
a state acquisition module 810, configured to acquire a first state of a reflection light 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 spot when the input device stops rotating in response to rotation of the input device;
the direction adjustment module 830 is configured to determine a second direction corresponding to the second state in the game scene if the second state of the reflected light spot meets a direction adjustment condition, and control 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 one 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, and determining that a steering instruction of the input device is received when the shape deviation angle is determined to be larger than the preset angle threshold.
In one possible implementation, as shown in fig. 9, the control apparatus 800 further includes a movement control module 850, where the movement control module 850 is configured to:
determining a moving track of the reflection light spot according to the acquired states of the reflection light spot;
and controlling the target virtual character to move according to the moving track.
In one possible implementation manner, when the orientation adjustment module 830 is configured to determine, if the second state of the reflected light spot meets the orientation adjustment condition, a second direction corresponding to the second state in the game scene, 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 relative to the first state is changed, 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 implementation, when the second state satisfies the direction adjustment condition that the second state of the reflected light spot changes relative to the direction of the shape of the first state, the direction adjustment module 830 is configured to determine, if the second state of the reflected light spot satisfies the direction adjustment condition, a second direction corresponding to the second state in the game scene, and control the target avatar to rotate from the first direction toward the second direction, where the direction adjustment module 830 is configured to:
in response to a steering instruction, determining the second direction according to a shape offset direction and a 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, the orientation adjustment module 830, when 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, 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;
the second direction is determined based on the rotation direction and the rotation angle.
In one possible implementation, when the second state satisfies the direction adjustment condition that the second state of the reflected light spot changes with respect to the light intensity of the first state, the direction adjustment module 830 is configured to determine, if the second state of the reflected light spot satisfies the direction adjustment condition, a second direction corresponding to the second state in the game scene, and control the target avatar to rotate from the first direction toward the second direction, where the direction adjustment module 830 is configured to:
when the light intensity of the second state of the reflection light spot is reduced relative to the first state, 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 one possible embodiment, when the orientation adjustment condition is that the shape of the second state changes relative to the first state, the second direction of the target avatar includes at least one of:
To the left of the target avatar, to the right of the target avatar, to the front of the target avatar, and to the rear of the target avatar.
In one possible implementation manner, when the orientation adjustment module 830 is configured to determine, if the second state of the reflected light spot meets the orientation adjustment condition, a second direction corresponding to the second state in the game scene, 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 reflection 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 one possible implementation, the orientation adjustment module 830 is configured to, when configured to determine a second direction based on a moving direction and a moving distance of the moving track, and control the target avatar to rotate from the first direction toward the second direction, the orientation adjustment module 830 is configured to:
Determining a rotation direction of the target virtual character based on the movement direction;
determining a rotation angle of the target virtual character based on the movement distance;
and determining the second direction based on the rotation direction and the rotation angle, and controlling the target virtual character to rotate from the first direction towards the second direction.
According to the control device for the virtual character, provided by the embodiment of the application, the first state of the reflection light spot corresponding to 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 second state of the reflection light spot is determined when the input device stops rotating in response to the rotation of the input device, the second direction corresponding to the second state is determined according to the direction adjustment condition met by the second state, and the target virtual character is controlled to rotate from the first direction to the second direction. According to the method and the device, according to the change of the states which are met by the reflection light spots corresponding to the analysis input device, the second direction which is required to be oriented by the virtual character and corresponds to the second state is directly determined according to the orientation adjustment conditions which are met by the second state of the reflection light spots after the input device rotates, so that the target virtual character is controlled to rotate towards the second direction, the adjustment time of the orientation of the target virtual character is saved, and the direction adjustment efficiency and the man-machine interaction efficiency are improved.
Referring to fig. 10, fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the application. 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 is running, the processor 1010 communicates with the memory 1020 through the bus 1030, and when the machine-readable instructions are executed by the processor 1010, the steps of the virtual character control method in the method embodiments shown in fig. 1 to 5 can be executed, and detailed implementation is referred to method embodiments and is not repeated herein.
The embodiment of the present application further provides a computer readable storage medium, where a computer program is stored, where the computer program when executed by a processor may perform the steps of the method for controlling a virtual character in the method embodiment shown in the foregoing fig. 1 to 5, and a specific implementation manner may refer to the method embodiment and will not be described herein.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown 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 may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in 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 this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that: the above examples are only specific embodiments of the present application, and are not intended to limit the scope of the present application, but it should be understood by those skilled in the art that the present application is not limited thereto, and that the present application is described in detail with reference to the foregoing examples: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (13)

1. A method for controlling a virtual character, wherein a graphical user interface is provided through a terminal device, at least part of a game scene and a target virtual character are displayed in the graphical user interface, the terminal device is externally connected with an input device, and the control method comprises:
acquiring a first state of a reflection light spot corresponding to the input device in a 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 rotation of the input device;
if the second state of the reflection light spot meets the direction 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 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 toward the second direction if the second state of the reflected light spot satisfies an orientation adjustment condition, comprises:
And when the shape of the second state relative to the first state is changed, 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 control method according to claim 2, wherein when the second state satisfies a direction adjustment condition that the second state of the reflected light spot changes with respect to a direction of a shape of a first state, determining a second direction corresponding to the second state in the game scene and controlling the target avatar to rotate from the first direction toward the second direction if the second state of the reflected light spot satisfies a direction adjustment condition, comprises:
in response to a steering instruction, determining the second direction according to a shape offset direction and a 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. A control method according to claim 3, wherein before said determining the second direction in accordance with the shape shift direction and the shape shift distance of the second state with respect to the first state in response to a steering instruction, 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, and determining that a steering instruction of the input device is received when the shape deviation angle is determined to be larger than the preset angle threshold.
5. A control method according to claim 3, wherein determining the second direction in response to a steering instruction from a shape offset direction and a shape offset distance of the second state relative to the first state comprises:
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;
the second direction is determined based on the rotation direction and the rotation angle.
6. The control method according to claim 2, wherein when the second state satisfies the direction adjustment condition that the second state of the reflected light spot changes with respect to the light intensity of the first state, determining a second direction corresponding to the second state in the game scene and controlling the target avatar to rotate from the first direction toward the second direction if the second state of the reflected light spot satisfies the direction adjustment condition, comprises:
When the light intensity of the second state of the reflection light spot is reduced relative to the first state, 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.
7. The control method according to claim 2, wherein when the orientation adjustment condition is that the second state changes in shape relative to the first state, the second direction of the target virtual character includes at least one of:
to the left of the target avatar, to the right of the target avatar, to the front of the target avatar, and to the rear of the target avatar.
8. The control method according to claim 1, wherein 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 toward the second direction if the second state of the reflected light spot satisfies an orientation adjustment condition, comprises:
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;
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 moving direction and the moving distance of the moving trajectory, and controlling the target virtual character to rotate from the first direction toward the second direction, includes:
determining a rotation direction of the target virtual character based on the movement direction;
determining a rotation angle of the target virtual character based on the movement distance;
and determining the second direction based on the rotation direction and the rotation angle, and controlling the target virtual character to rotate from the first direction towards the second direction.
10. The control method according to claim 1, characterized in that the control method further comprises, while responding to the rotation of the input device:
determining a moving track of the reflection light spot according to the acquired states of the reflection light spot;
and controlling the target virtual character to move according to the moving track.
11. A virtual character control device, characterized in that a graphical user interface is provided through a terminal device, at least part of a game scene and a target virtual character are displayed in the graphical user interface, the terminal device is externally connected with an input 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 determining module for determining a second state of the reflected light spot when the input device stops rotating in response to rotation of the input device;
the direction adjusting module is used for 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 reflection light spot meets the direction adjusting condition; 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 over the bus when the electronic device is running, the processor executing the machine-readable instructions to perform the steps of the method of controlling a virtual character according to any one of claims 1 to 10.
13. A computer-readable storage medium, on which a computer program is stored, which computer program, 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 CN113440841A (en) 2021-09-28
CN113440841B true 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 (9)

* 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
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
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

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10549180B2 (en) * 2013-09-30 2020-02-04 Zynga Inc. Swipe-direction gesture control for video games using glass input devices
CN106598438A (en) * 2016-12-22 2017-04-26 腾讯科技(深圳)有限公司 Scene switching method based on mobile terminal, and mobile terminal

Patent Citations (9)

* 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
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
CN113440841A (en) 2021-09-28

Similar Documents

Publication Publication Date Title
CN111124226B (en) Game screen display control method and device, electronic equipment and storage medium
EP3469466B1 (en) Directional interface object
CN106659932B (en) Sensory stimulus management in head mounted displays
EP3003517B1 (en) Image rendering responsive to user actions in head mounted display
CN108404407B (en) Auxiliary aiming method and device in shooting game, electronic equipment and storage medium
CN108415639B (en) Visual angle adjusting method and device, electronic device and computer readable storage medium
EP1595584B1 (en) Image processing program, game information processing program and game information processing apparatus
US20230092439A1 (en) Virtual console gaming controller
EP2394710A2 (en) Image generation system, image generation method, and information storage medium
WO2023045375A1 (en) Method and apparatus for spectating game after character is killed, and electronic device and storage medium
JP4054037B2 (en) Shooting game machine
CN113975807A (en) Method and device for generating information in game, electronic equipment and readable storage medium
CN113117332A (en) Method and device for adjusting visual angle of lens, electronic equipment and storage medium
US20220241691A1 (en) Method and system for providing tactical assistance to a player in a shooting video game
JP2001232056A (en) Video game device, image expression method, program control method and storage medium
CN113440841B (en) Virtual character control method and device, electronic equipment and readable storage medium
CN113262473A (en) Interactive control method and device in game, electronic equipment and storage medium
EP3550418A1 (en) Application control program, application control method, and application control system
WO2024001191A1 (en) Operation method and apparatus in game, nonvolatile storage medium, and electronic apparatus
CN112870701A (en) Control method and device of virtual role
JP5205757B2 (en) GAME PROGRAM AND GAME DEVICE
KR102598659B1 (en) Selective indication of off-screen object presence
CN113663326B (en) Aiming method and device for game skills
JP2007301044A (en) Game device and game program used in the game device
KR20230158075A (en) Computer programs, gaming systems and control methods used in them

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