METHOD AND TERMINAL FOR IMPLEMENTING VIRTUAL CHARACTER TURNING

22-12-2016 дата публикации
Номер:
CA0002975004A1
Принадлежит: Tencent Technology Shenzhen Co Ltd
Контакты:
Номер заявки: 2975004
Дата заявки: 01-02-2016

METHOD AND TERMINAL FOR IMPLEMENTING VIRTUAL CHARACTER TURNING

[1]

RI i Λ 11 i ) APPLICATION

[2]

[0001 1 This application claims priority to Chinese Patent Application No.

[3]

201510334763.4. filed with the Chinese Patent Office on June 16. 2015 and entitled "MLTIIOD AND APPARA TUS FOR IMPLEMENTING TURNING OF VIRTUAL Cl IARACTLR". which is incorporated herein by reference in its entirety.

[4]

Fil l I) Of ! HI I I.CI1NOI 0(0

[5]

10002] 'The present disclosure relates to the field of data processing, and in particular, to a method and a terminal for implementing turning of a virtual character.

BACKGROUND Of’ THE DISCLOSURE

[6]

100031 Rapid development of computer technologies has brought much convenience to people's life and has greatly improved people's life quality. When enjoying convenient life, people also need some entertainments. Therefore, various game products emerge. In a scenario of a conventional game product, when a player controls a v irtual character to generate a turning angle by means of displacements, a fixed turning angle is generally used, and each time a turning movement is generated, the player always turns by the fixed turning angle. As shown in FIG. 1. a fixed turning angle a is set. Once a virtual character turns, if a turning angle is less than the fixed turning angle a, the virtual character does not turn; or if a turning angle is greater than the fixed turning angle a. the virtual character turns excessively quickly in an obviously reduced time, and consequently, picture non-fiuency and stalling occur.

SUMMARY

[7]

10004 J Based on this, to resolve a conventional problem that picture non-ilucncy and stalling occur when a virtual character turns, it is necessary to provide a method for implementing turning of a virtual character, so that turning can be implemented, stalling can be av oided in a turning process, and picture fluency can be improved.

[8]

10005] In addition, it is also necessary to provide an apparatus for implementing turning of a virtual character, so that turning can be implemented, stalling can be avoided in a turning process, and picture fluency can be improved.

[9]

100061 One aspect of the present disclosure provides a method for implementing turning of a virtual character, including: obtaining a turning angle of a virtual character: obtaining a preset fixed turning time; calculating an average angular velocity of the virtual character according to the turning angle and the preset fixed turning time; and controlling the virtual character to turn at the average angular velocity.

[10]

100071

[11]

Another aspect of the present disclosure provides an apparatus for implementing turning of a virtual character, including: an angle obtaining module, configured to obtain a turning angle of a v irtual character;

[12]

a time obtaining module, configured to obtain a preset fixed turning time;

[13]

a processing module, configured to calculate an average angular velocity of the virtual character according to the turning angle and the preset fixed turning time; and

[14]

an execution module, configured to control the virtual character to turn at the average angular velocity.

[15]

100081 According to the method and the apparatus for implementing turning of a virtual character, a turning angle of a virtual character is obtained, a preset fixed turning time is obtained, an average angular velocity is calculated, and the virtual character is controlled to turn at the average angular velocity, 'fuming is performed at a constant speed in a turning process, smooth turning can be implemented, stalling is avoided in the turning process, and picture fluency can be improved. When the turning angle is relatively large, the average angular velocity is high, and quick and smooth turning can be implemented: or when the turning angle is small, turning can also be implemented. Therefore, turning is more precise.

BRIHF DESCRIPTION Of 111! DRAWINGS

[16]

100091 To describe the technical solutions in the embodiments of the present invention or in the existing technologies more clearly, the following briefly describes the accompanying drawings required for describing the embodiments or the existing technologies. Apparently, the accompanying drawings in the following description show merely some embodiments of the present invention, and a person of ordinary skill in the art may still derive other drawings from these accompanying drawings without creative efforts.

[17]

1001 01 MG. 1 is a schematic diagram of a fixed turning angle set in the conventional technology;

[18]

1001 1 | MG. 2Α is a schematic diagram of an internal structure of a terminal according to an embodiment;

[19]

100 ! 2 j FIG. 2Β is a schematic diagram of an internal structure of a server according to an embodiment;

[20]

|0()13| FIG. 3 is a flowchart of a method for implementing turning of a virtual character according to an embodiment;

[21]

10014] FIG. 4 is a flowchart of obtaining a turning angle of a virtual character according to an embodiment;

[22]

[001 51 FIG. 5 is a schematic diagram of forming a turning angle;

[23]

[ 00161 FIG. 6 is a schematic diagram of implementing turning of a virtual character in a standalone game;

[24]

[0017] FIG. 7 is a sequence diagram of processing for implementing turning of a virtual character in an online game;

[25]

1001 81 FIG. 8 is a schematic effect diagram showing that an NPC is controlled to turn at a constant speed:

[26]

1001G | FIG. 0 is a structural block diagram of an apparatus for implementing turning of a virtual character according to an embodiment; and

[27]

100201 FIG. 10 is a structural block diagram of an apparatus for implementing turning of a virtual character according to another embodiment.

[28]

Dl.SC'RlI’ 1 ION OF' FMBODIMFNTS

[29]

[0021 ] To make the objectives, technical solutions, and adv antages of the present disclosure clearer and more comprehensible, the following further describes the present disclosure in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely used to explain the present disclosure but are not intended to limit the present disclosure.

[30]

((10221 U may be understood that terms "first", "seeond" and the like used in the present disclosure may he used to describe various elements in this specification, but the elements are not limited to the terms. The terms are merely used to distinguish a first element with another element. For example, in a ease not departing from the scope of the present disclosure, a first client may be referred to as a seeond client, and similarly, a second client may be referred to as a first client. Both the first client and the seeond client are clients, but are not a same client.

[31]

100231 FIG. 2 A is a schematic diagram of an internal structure of a terminal according to an embodiment. As shown in FIG. 2Α, the terminal includes a processor, a storage medium, a memory, and a network interface, a voice collection apparatus, a display, a speaker, and an input apparatus that are connected by using a system bus. The storage medium of the terminal stores an operating sy stem, and further includes an apparatus for implementing turning of a virtual character, and the apparatus for implementing turning of a virtual character is configured to implement a method for implementing turning of a virtual character. The processor is configured to prov ide computing and control capabilities, to support operation of the entire terminal. The memory of the terminal provides an environment for operation of the apparatus for implementing turning of a virtual character in the storage medium. The network interface is configured to perform network communication w ith a server, for example, upload data of a virtual character to the serv er, and receive related data of the virtual character that is returned by the server. The display of the terminal may be a liquid crystal display, an F-ink display, or the like. The input apparatus may be a touch layer covered on the display, or may be a button, a track ball, or a touchpad disposed on an external housing of the terminal, or may be an externally connected keyboard, touchpad, mouse, or the like. The terminal may be a mobile phone, a tablet computer, or a personal digital assistant. A person skilled in the art may understand that FIG. 2Α is merely one instance of structural block diagrams related to the solution of this application, and does not constitute a limit to the terminal to which the solution of this application is applied. Specifically, the terminal may include more or less components than those shown in the figure, or combine some components, or have different component deployments.

[32]

100241 FIG. 2Β is a schematic diagram of an internal structure of a server according to an embodiment. As shown in FIG. 2Β. the server includes a processor, a storage medium, a memory, and a network interface that are connected by using a system bus. The storage medium of the server stores an operating system, a database, and an apparatus for implementing turning of a virtual character, the database stores game scenario data and data related to a virtual character, and the apparatus for implementing turning of a virtual character is configured to implement a method for implementing turning of a virtual character. The processor of the server is configured to provide computing and control capabilities, to support operation of the entire server. The memory of the serv er provides an environment for operation of the apparatus for implementing turning of a virtual character in the storage medium. The network interface of the server is configured to perform connection and communication with an external terminal by using a network, for example, receive data of a virtual character that is uploaded by the terminal, and return other data of the virtual character to the terminal. The server may be implemented by an independent server or a server cluster formed by multiple servers. A person skilled in the art ma\ understand that FIG. 2Β is merely one of structural block diagrams related to the solution of this application, and does not constitute a limit to the server to which the solution of this application is applied. Specifically, the server may include more or less components than those shown in the figure, or combine some components, or have various component deployments.

[33]

10025] FIG. 3 is a flowchart of a method for implementing turning of a virtual character according to an embodiment. As shown in FIG. 3, a method for implementing turning of a virtual character includes the following steps:

[34]

[0026] Step 302: Obtaining a turning angle of a virtual character.

[35]

100271 Specifically, the \ irtual character refers to a virtual character in a game. Different characters max' be selected according to different occupations. A game client is started and operated on a terminal. In a standalone game, no registration is needed, and only an entered character needs to be used as a username of a player for this time; in an online game, a server is logged in by using a registered account for a network connection, to perform an interactive operation with other users,

[36]

10028 ] The terminal may be a desktop computer, a notebook computer, a tablet computer, a smartphone, a personal digital assistant, or the like.

[37]

100201 The turning angle refers to an angle by which a v irtual character is controlled to rotate, and for case of calculation, the turning angle may be a value between 0 degrees and 360 degrees. The x irtual character rotates when an input device such as a keyboard, a mouse, or a touchscreen enters an instruction. After a rotation angle exceeds 360 degrees, a remaining angle is obtained by subtracting 360 degrees multiplied by an integer multiple from the rotation angle, and the remaining angle is used as the turning angle.

[38]

10030] l he obtained turning angle may be, for example, 30 degrees. 40 degrees, or 280 degrees.

[39]

(003 1 | Step 304: Obtaining a preset fixed turning time.

[40]

100321 Specifically, the preset fixed turning time refers to a fixed turning time set as required, and after the turning time is set, a turning time consumed is the fixed turning time regardless of a value of the turning angle. The fixed turning time may he 0.1 second. 0.2 second, or 1 second. 1 he preset fixed turning time ma}' be. for example, stored locally in a form of a configuration file.

[41]

10033 ] Step 306: Calculating an average angular velocity of the virtual character according to the turning angle and the preset fixed turning time.

[42]

100341 Specifically, the step of calculating an average angular velocity of the virtual character according to the turning angle and the preset fixed turning time includes: dividing the turning angle hy the preset fixed turning time to obtain an average angular velocity of the virtual character. A calculation formula is the following formula ( 1 ):

[43]

a)

[44]

l! ■■ -

[45]

MD

[46]

!0035 ] In the formula ( Î ), 10 is a turning angle,/ is a preset fixed turning time, and v is an average angular velocity.

[47]

10036) for example, a turning angle is 280 degrees and a preset fixed turning time is 0.1 second, and in this case, an average angular velocity is 280 dcgrees/0.1 second and is equal to 2 8 00 d e g r ℮ ℮ s / s ℮ c ο η d.

[48]

[t)0.37 | Step 308: Controlling the virtual character to turn at the average angular \elocity. 100381 Specifically, in a game scenario, a virtual character is controlled to turn at a constant speed of the average angular v elocity , and when the virtual character turns to an end position, turning is stopped.

[49]

1003e)] According to the method for implementing turning of a virtual character, a turning angle of a v irtual character is obtained, a preset fixed turning time is obtained, an av erage angular velocity is calculated, and the virtual character is controlled to turn at the average angular velocity, l urning is performed at a constant speed in a turning process, smooth turning can be implemented, stalling is avoided in the turning process, and picture fluency can be improved. When the turning angle is relativ ely large, the average angular velocity is high, and quick and smooth turning can be implemented; or when the turning angle is small, turning can also be implemented. Therefore, turning is more precise.

[50]

10040] FIG. 4 is a flowchart of obtaining a turning angle of a virtual character according to an embodiment. As shown in FIG. 4, steps of obtaining a turning angle of a virtual character includes the following steps:

[51]

j 0041 ] Step 402: Obtaining a start position, a turning direction, and an end position of a virtual character.

[52]

10042 ] Specifically, a position of the virtual character is recorded in real time. At a time point when the virtual character is controlled to turn, a position at which the virtual character is located at this lime is obtained as a turning start position. When a user generates an input instruction by using an input device, to control the virtual character to rotate to a position and stop rotation, a position at which rotation ends is recorded as the end position, and a rotation direction is recorded as the turning direction. The turning direction may be a clockwise direction or a counterclockwise direction.

[53]

10044 | Step 404: Obtaining a turning angle of the virtual character according to the start position, the turning direction, and the end position of the virtual character.

[54]

10044 j Specifically, the start position, the turning direction, and the end position of the virtual character arc draw n to form the turning angle, and a value of the turning angle is calculated by using an angle calculator or a computation program.

[55]

100451 It is convenient to calculate the turning angle of the virtual character by obtaining the start position, the turning angle, and the end position of the virtual character.

[56]

100461 FIG. 5 is a schematic diagram of forming a turning angle. As shown in FIG. 5, a start position of a virtual character is a line 52, the virtual character rotates counterclockw ise, a turning direction is counterclockw ise, an end position of the virtual character is a line 54, and the start position, the turning direction, and the end position form a turning angle b. Λ value of the turning angle b is calculated by using an angle calculator or a computation program.

[57]

100471 In an embodiment, the obtaining a turning angle of a virtual character includes:

[58]

obtaining a turning instruction generated by means of touch input, voice input, or gesture input;

[59]

and obtaining a turning angle of a virtual character according to the turning instruction.

[60]

10048] Specifically, generating a turning instruction by means of touch input refers to entering and generating a corresponding turning instruction by touching a touchscreen of mobile terminals such as a smartphone, for example, rotating clockwise or rotating counterclockwise on a touchscreen. Λ start position, a turning direction, and an end position of a virtual character may be obtained according to the input instruction generated by touching, and a turning angle of the virtual character may be calculated according to the start position, the turning direction, and the end position of the virtual character.

[61]

100491 Generating a turning instruction by means of voice input refers to receiving voice information of a user, and recognizing the voice information to obtain a corresponding turning instruction. In voice input, a voice instruction recognition library needs to be created first, and the voice instruction recognition library records a correspondence between voice information and an instruction. After voice information of a user is recognized, a corresponding turning instruction is generated according to the voice information and the correspondence between voice information and an instruction. For example, content of voice information is rotating by 90 degrees clockwise.

[62]

[00501 Generating a turning instruction by means of gesture input refers to receiving an input gesture, and recognizing the gesture to obtain a corresponding turning instruction. In gesture input, a gesture instruction recognition library needs to be created first, and the voice recognition library records a correspondence between voice information and an instruction. After a gesture of a user is recognized, a corresponding turning instruction is generated according to the gesture and the correspondence between a gesture and an instruction. For example, content of gesture information is rotating by 60 degrees clockwise.

[63]

[ 0()A 1 ] in an embodiment, the method for implementing turning of a virtual character lurther includes: recording and storing each turning time and a corresponding end position of the \ irtual character.

[64]

100521 Speciilcally. in a game scenario, a virtual character may be controlled to turn for multiple times, and a turning time and a corresponding end position are recorded for each time, to facilitate follow-up synchronization and update. The turning time refers to a time point at w hich turning is started. For example, a recorded turning time is at 1 o'clock 24 minutes 30 seconds, and an end position is represented by map coordinates (χ. y) or a longitude and a latitude in the name scenario.

[65]

10053 | In an embodiment, the method for implementing turning of a virtual eharaeter further includes: comparing periodically each turning time and a corresponding end position of the virtual character that are recorded locally with each turning time and a corresponding end position of the virtual eharaeter that are recorded in a server, when a network is connected; and uploading each turning time and the corresponding end position of the virtual character that are recorded locally to the server, to update each turning time and the corresponding end position of the virtual character that are recorded in the server, if each turning time and the corresponding end position of the virtual eharaeter that are recorded locally are not the same as each turning time and the corresponding end position of the virtual character that are recorded in the server; or skipping update, if each turning time and the corresponding end position of the virtual character that are recorded locally are the same as each turning time and the corresponding end position of the v irtual character that are recorded in the server.

[66]

100541 Specifically, the terminal is connected to the server, a game client on the terminal is connected to a game server, and a user logs in to the game server by using an account, bach turning time and a corresponding end position of the virtual character is recorded locally (that is. on the terminal), bach turning time and the corresponding end position of the virtual character that are recorded locally may be compared periodically with each turning time and the corresponding end position of the virtual character that are recorded in the serv er, to compare whether data of the two is the same. If the data of the two is not the same, each turning time and the corresponding end position of the virtual character that are recorded locally may be uploaded to the server, to update each turning time and the corresponding end position of the virtual character that are recorded in the server, and an end position of the virtual character after final turning may be displayed.

[67]

(0055] In addition, a start position and an average angular velocity of the virtual character mav further he recorded.

[68]

10056] The end position of the virtual character after the (Inal turning is displayed on the terminal, and the user cannot sense a periodic comparison process on the terminal. When the server sends end position information of the virtual character on a terminal to another terminal for displaying, a buffering manner is used to ensure consistency of data and avoid stalling.

[69]

100571 It should he noted that data for calculating the turning angle does not need to be uploaded to the server, and calculation processing is performed locally, to save a network resource and reduce a burden on the server. Certainly, alternatively, the server may calculate the turning angle and the average angular velocity.

[70]

(00581 To describe more clearly the method for implementing turning of a virtual character, descriptions of processing processes in w hich the method is applied to a standalone game and an online game are provided below.

[71]

100591 I KI. 6 is a schematic diagram of implementing turning of a virtual character in a standalone game, in a standalone game, a user enters a game scenario by entering a player name or a player number, and in the game scenario, the user may control a corresponding virtual character 62 by using input devices such as a keyboard, a mouse, or a touchscreen. A process of implementing turning ol the virtual character 62 includes: obtaining a start position, a turning direction, and an end position of the virtual character acc .aller the turning instruction entered by the user is delected, forming a turning angle according to the start position, the turning direction, and the end position of the virtual character, calculating a value of the turning angle, obtaining a preset fixed turning time from a configuration file, dividing the

[72]

turning angle by the iixed turning time to obtain an average angular velocity, and performing turning at a constant speed of the average angular velocity. Therefore, smooth turning and picture llueney are implemented. In FIG. 6, the virtual character 62 is controlled to turn by 90° from a position 1 to a position 2, that is. directly lacing a little monster 64. The little monster is a virtual creature in the game scenario.

[73]

100601 FIG. 7 is a sequence diagram of processing for implementing turning of a virtual character in an online game. In an online game, each user logs in to a game server by using a registered account, and enters a game scenario by using a virtual character name corresponding to the registered account, and the user may control a corresponding virtual character by using input devices such as a keyboard, a mouse, or a touchscreen. As shown in FIG. 7. a process of implementing turning of a virtual character includes the following steps: (1 ) detecting, by a First terminal, a turning instruction entered by a first user; (2) obtaining, by the first terminal according to the turning instruction, a start position, a turning direction, and an end position of a first virtual character corresponding to the fust user; (3) forming, by the first terminal, a turning angle of the virtual character according to the start position, the turning direction, and the end position of the first virtual character, and calculating a value of the turning angle of the first \ irtuai character; (4) obtaining, by the first terminal, a preset fixed turning time; (5) calculating, by the first terminal, an average angular velocity of the first virtual character according to the value of the turning angle of the first virtual character and the fixed turning time; (6) controlling, by the first terminal, the first virtual character to turn to a corresponding end position at the average angular velocity; (7) recording and storing, by the first terminal, the turning time, the start position, the average turning speed, and the corresponding end position of the first virtual character; (8) uploading, by the first terminal, the turning time, the start position, the average turning speed, and the corresponding end position of the first virtual character to a server; (9) receiving, by the server, the start position, the average turning speed, and the end position of the first virtual character, and sending the start position, the average turning speed, and the end position of the first virtual character to a second terminal; and (10) displaying turning of the first virtual character from the start position to the end position on the second terminal.

[74]

[0061 ] For example, the back of a first virtual character is toward a second virtual character, and alter the first virtual character turns by 180 degrees, the first virtual character faces towards the second virtual character.

[75]

[ 0062J The method for implementing turning of a virtual character may be applied to a multiplayer online battle arena games (ΜΟΒΛ) scenario and a mobile game product. The mobile game may include a standalone game and an online game. In an ΜΟΒΑ scenario or a mobile game, a player controls an NPC (a character in the game, that is, a virtual character) to turn.

[76]

Because a turning time is preset, and a turning angle is obtained, an average angular velocity may be obtained by dividing the turning angle by the turning time, and the NPC is controlled to turn at the average angular velocity, to avoid stalling that occurs in a turning process and improve fluency of a turning picture. As shown in FIG. 8, in a mobile game, an NPC is controlled to turn by a corresponding angle A at a constant speed within a time t.

[77]

10063] In addition, the method for implementing turning of a virtual character may also be applied to a game scenario in which an operation is performed by using a mouse on a personal computer, a corresponding turning angle is obtained by obtaining a start position of a virtual character controlled by a mouse, and an end position after turning, a corresponding average angular velocity is obtained by obtaining a ratio of the turning angle to the time, and the virtual character is controlled to turn at a constant speed of the average angular velocity, so that stalling that occurs in a turning process may be avoided, and fluency of a turning picture may be improved.

[78]

[0064 ] FIG. 9 is a structural block diagram of an apparatus for implementing turning of a virtual character according to an embodiment. As shown in FIG. 9, the apparatus for implementing turning of a virtual character is operated on a terminal, and includes an angle obtaining module 910. a time obtaining module 920, a processing module 930. and an execution module 940.

[79]

[0065] The angle obtaining module 910 is configured to obtain a turning angle of a virtual character.

[80]

10066] Specifically, the virtual character refers to a virtual character in a game. Different characters may be selected according to different occupations. A game client is started and operated on a terminal. In a standalone game, no registration is needed, and only an entered character needs to be used as a username of a player for this time; in an online game, a server is logged in by using a registered account for a network connection, to perform an interactive operation with other users.

[81]

[0067] The terminal may be a desktop computer, a notebook computer, a tablet computer, a smartphone, a personal digital assistant, or the like.

[82]

[0068] The turning angle refers to an angle by which a virtual character is controlled to rotate, and for ease of calculation, the turning angle may be a value between 0 degrees and 360 degrees. The virtual character rotates when an input device such as a keyboard, a mouse, or a touchscreen enters an instruction. After a rotation angle exceeds 360 degrees, a remaining angle is obtained by subtracting 360 degrees multiplied by an integer multiple from the rotation angle, and the remaining angle is used as the turning angle.

[83]

10069] The obtained turning angle may be. for example, 30 degrees, 40 degrees, or 280 degrees.

[84]

[0070] In an embodiment, the angle obtaining module 910 is further configured to: obtain a start position, a turning direction, and an end position of a virtual character; and obtain a turning angle of the virtual character according to the start position, the turning direction, and the end position of the virtual character.

[85]

10071 ] Specifically, a position of the virtual character is recorded in real time. At a time point when the virtual character is controlled to turn, a position at which the virtual character is located at this time is obtained as a turning start position. When a user generates an input instruction by using an input device, to control the virtual character to rotate to a position and stop rotation, a position at which rotation ends is recorded as the end position, and a rotation direction is recorded as the turning direction. The turning direction may be a clockwise direction or a counterclockwise direction. The start position, the turning direction, and the end position the virtual character are drawn to form the turning angle, and a value of the turning angle is calculated by using an angle calculator or a computation program. It is convenient to calculate the turning angle of the virtual character by obtaining the start position, the turning direction, and the end position of the virtual character.

[86]

10072] In an embodiment, the angle obtaining module 910 is further configured to: obtain a turning instruction generated by means of touch input, voice input, or gesture input; and obtain a turning angle of a virtual character according to the turning instruction.

[87]

[ 0073] Specifically, generating a turning instruction by means of touch input refers to entering and generating a corresponding turning instruction by touching a touchscreen, for example, rotating clockwise or rotating counterclockwise on a touchscreen. A start position, a turning direction, and an end position of a virtual character may be obtained according to the input instruction generated by touching, and a turning angle of the virtual character may be calculated according to the start position, the turning direction, and the end position of the virtual character.

[88]

[0074] Generating a turning instruction by means of voice input refers to receiving voice information of a user, and recognizing the voice information to obtain a corresponding turning instruction. In voice input, a voice instruction recognition library needs to be created first, and the voice instruction recognition library records a correspondence between voice information and an instruction. After voice information of a user is recognized, a corresponding turning instruction is generated according to the voice information and the correspondence between voice information and an instruction. For example, content of voice information is rotating by 90 degrees clockwise.

[89]

[0075] Generating a turning instruction by means of gesture input refers to receiving an input gesture, and recognizing the gesture to obtain a corresponding turning instruction. In gesture input, a gesture instruction recognition library needs to be created first, and the gesture instruction recognition library records a correspondence between gesture information and an instruction. After a gesture of a user is recognized, a corresponding turning instruction is generated according to the correspondence between gesture information and an instruction. For example, content of gesture information is rotating by 60 degrees clockwise.

[90]

[0076] The time obtaining module 920 is configured to obtain a preset fixed turning time.

[91]

j0077] Specifically, the preset fixed turning time refers to a fixed turning time set as required, and after the turning time is set, a turning time consumed is the fixed turning time regardless of a value of the turning angle. The fixed turning time may be 0.1 second, 0.2 second, or 1 second. The preset fixed turning time may be, for example, stored locally in a form of a configuration file.

[92]

[0078J The processing module 930 is configured to calculate an average angular velocity of the virtual character according to the turning angle and the preset fixed turning time.

[93]

[0079] Specifically, the step of calculating an average angular velocity of the virtual character according to the turning angle and the preset fixed turning time includes: dividing the turning angle by the preset fixed turning time to obtain an average angular velocity of the virtual character. A calculation formula is the following formula (1):

[94]

ω

[95]

υ = -

[96]

' (If

[97]

[0080] In the formula (1), (0 is a turning angle, 1 is a preset fixed turning time, and ° is an average angular velocity.

[98]

10081 ] For example, a turning angle is 280 degrees and a preset fixed turning time is 0.1 second, and in this case, an average angular velocity is 280 dcgrccs/0.1 second and is equal to 2800 degrees/second.

[99]

[0082] The execution module 840 is configured to control the virtual character to turn at the average angular velocity.

[100]

[0083] Specifically, in a game scenario, a virtual character is controlled to turn at a constant speed of the average angular velocity, and when the virtual character turns to an end position, turning is stopped.

[101]

[00841 According to the apparatus for implementing turning of a virtual character, a turning angle of a virtual character is obtained, a preset fixed turning time is obtained, an average angular velocity is calculated, and the virtual character is controlled to turn at the average angular velocity. Turning is performed at a constant speed in a turning process, smooth turning can be implemented, stalling is avoided in the turning process, and picture fluency can be improved. When the turning angle is relatively large, the average angular velocity is high, and quick and smooth turning can be implemented; or when the turning angle is small, turning can also be implemented. Therefore, turning is more precise.

[102]

[00851 FIG. 10 is a structural block diagram of an apparatus for implementing turning of a virtual character according to another embodiment. As shown in FIG. 10, the apparatus for implementing turning of a virtual character is operated on a terminal, and in addition to the angleobtaining module 910, the time obtaining module 920, the processing module 930. and the execution module 940, the apparatus further includes a recording and storage module 950. a comparison module 960, and an upload module 970.

[103]

10086] The recording and storage module 950 is configured to record and store each turning time and a corresponding end position of a virtual character.

[104]

[0087] Specifically, in a game scenario, a virtual character may be controlled to turn for multiple times, and a turning time and a corresponding end position are recorded for each time, to facilitate follow-up synchronization and update. The turning time refers to a time point at

[105]

which turning is started. For example, a recorded turning time is at 1 o'clock 24 minutes 30 seconds, and an end position is represented by map coordinates (χ, y) or a longitude and a latitude in the game scenario. In addition, a start position and an average angular velocity of the virtual character may further be recorded.

[106]

[0088] The comparison module 960 is configured to compare periodically each turning time and a corresponding end position oflhc virtual character that are recorded locally with each turning time and a corresponding end position of the virtual character that are recorded in a server, when a network is connected.

[107]

100891 The upload module 970 is configured to upload each turning time and the corresponding end position of the virtual character that are recorded locally to the server, to update each turning time and the corresponding end position of the virtual character that are recorded in the server, when each turning time and the corresponding end position of the virtual character that arc recorded locally are not the same as each turning time and the corresponding end position of the virtual character that are recorded in the server.

[108]

[00901 Specifically, each turning time and the corresponding end position of the virtual character that are recorded locally may be compared periodically with each turning time and the corresponding end position of the virtual character that are recorded in the server, to compare whether data of the two is the same. If the data of the two is not the same, each turning time and the corresponding end position of the virtual character that are recorded locally may be uploaded to the server, to update each turning time and the corresponding end position of the virtual character that are recorded in the server, and an end position of the v irtual character after final turning may be displayed.

[109]

[0091 ] Λ person of ordinary skill in the art may understand that all or some of the

[110]

processes of the methods in the foregoing embodiments may be implemented by a computer program instructing relevant hardware. The program may be stored in a non-volatile computer readable storage medium. When the program is executed, processes of the foregoing method embodiments may be performed. The storage medium may be a magnetic disk, an optical disc, a read-only memory (ROM), or the like.

[111]

[0092] The foregoing embodiments only describe several implementation manners of the present disclosure, and their description is specific and detailed, but cannot therefore be understood as a limitation to the patent scope of the present disclosure. It should be noted that, a person of ordinary skill in the art may further make some variations and improvements without departing from the concept of the present disclosure, and the variations and improvements belong to the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the appended claims.



A method and terminal for implementing virtual character turning. The method comprises the following steps: acquiring a turning angle of a virtual character (302); acquiring pre-set fixed turning time (304); calculating, according to the turning angle and the pre-set fixed turning time, an average angular speed of the virtual character (306); and controlling, at the average angular speed, the virtual character to turn (308). The virtual character turning method and terminal acquire a turning angle of a virtual character, acquire pre-set fixed turning time, calculate an average angular speed, and control, at the average angle speed, the virtual character to turn. In a turning process, the virtual character turns at a constant speed so as to be capable of turning smoothly, such that the phenomenon of blocking in the turning process is avoided, and the smoothness of a picture is improved. Moreover, when the turning angle is large, the average angular speed is high, and the virtual character can turn quickly and smoothly. When the turning angle is small, the turning can also be implemented, and the turning is more accurate.



1. A method for implementing turning of a virtual character, comprising:

obtaining a turning angle of a virtual character;

obtaining a preset fixed turning time;

calculating an average angular velocity of the virtual character according to the turning angle and the preset fixed turning time; and

controlling the virtual character to turn at the average angular velocity.

2. The method according to claim 1, wherein the obtaining a turning angle of a virtual character comprises:

obtaining a start position, a turning direction, and an end position of the virtual character;

and

obtaining the turning angle of the virtual character according to the start position, the turning direction, and the end position of the virtual character.

3. The method according to claim 1. wherein the obtaining a turning angle of a virtual character comprises:

obtaining a turning instruction generated by means of touch input, voice input, or gesture input; and

obtaining the turning angle of the virtual character according to the turning instruction.

4. The method according to claim 2, wherein the method further comprises:

recording and storing each turning time and a corresponding end position of the virtual

character.

5. The method according to claim 4, wherein the method further comprises:

comparing periodically each turning time and a corresponding end position of the virtual character that are recorded locally w ith each turning time and a corresponding end position of the virtual character that are recorded in a server, when a network is connected; and uploading each turning time and the corresponding end position of the virtual character that are recorded locally to the server, to update each turning time and the corresponding end position of the virtual character that are recorded in the server, if each turning time and the corresponding end position of the virtual character that are recorded locally arc not the same as each turning time and the corresponding end position of the virtual character that arc recorded in the server.

6. A terminal, comprising a storage medium and a processor, the storage medium storing an instruction, and when the instruction is executed by the processor, the processor is directed to;

obtain a turning angle of a virtual character;

obtain a preset fixed turning time;

calculate an average angular velocity of the virtual character according to the turning angle and the preset fixed turning time; and

control the virtual character to turn at the average angular velocity.

7. The terminal according to claim 6, wherein the obtaining a turning angle of a virtual character comprises:

obtaining a start position, a turning direction, and an end position of a virtual character; and obtaining the turning angle of the virtual character according to the start position, the turning direction, and the end position of the virtual character.

8. The terminal according to claim 6. wherein the obtaining a turning angle of a virtual character comprises:

obtaining a turning instruction generated by means of touch input, voice input, or gesture input; and

obtaining the turning angle of a virtual character according to the turning instruction.

9. The terminal according to claim 8. wherein the processor of the terminal is further configured to:

record and store each turning time and a corresponding end position of the virtual character.

10. The terminal according to claim 9, wherein the processor of the terminal is further configured to:

compare periodically each turning time and a corresponding end position of the virtual character that arc recorded locally with each turning time and a corresponding end position of the virtual character that are recorded in a server, when a network is connected; and upload each turning time and the corresponding end position of the virtual character that are recorded locally to the server, to update each turning time and the corresponding end position of the virtual character that arc recorded in the server, if each turning time and the corresponding end position of the virtual character that are recorded locally are not the same as each turning time and the corresponding end position of the virtual character that are recorded in the server.