Movatterモバイル変換


[0]ホーム

URL:


CN113769406A - Control method and device of virtual role, storage medium and electronic device - Google Patents

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

Info

Publication number
CN113769406A
CN113769406ACN202111101619.8ACN202111101619ACN113769406ACN 113769406 ACN113769406 ACN 113769406ACN 202111101619 ACN202111101619 ACN 202111101619ACN 113769406 ACN113769406 ACN 113769406A
Authority
CN
China
Prior art keywords
virtual character
sub
environment
skill
virtual
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111101619.8A
Other languages
Chinese (zh)
Other versions
CN113769406B (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.)
Beijing Bingfeng Mutual Entertainment Technology Co ltd
Original Assignee
Beijing Bingfeng Mutual Entertainment Technology 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 Beijing Bingfeng Mutual Entertainment Technology Co ltdfiledCriticalBeijing Bingfeng Mutual Entertainment Technology Co ltd
Priority to CN202111101619.8ApriorityCriticalpatent/CN113769406B/en
Publication of CN113769406ApublicationCriticalpatent/CN113769406A/en
Application grantedgrantedCritical
Publication of CN113769406BpublicationCriticalpatent/CN113769406B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The invention provides a control method and device of a virtual role, a storage medium and an electronic device, wherein the method comprises the following steps: detecting a first light skill initiated by a first virtual character on a first environmental element of a game scene toward a second environmental element, wherein the first environmental element and the second environmental element intersect vertically in the game scene; calculating a first location parameter between the first environmental element and the second environmental element; and if the first position parameter meets a first preset condition, moving the first virtual character from the first environment element to the second environment element, and switching the game mode of the first virtual character into a fighting light power mode, wherein the fighting light power mode is used for realizing that the first virtual character simultaneously releases fighting skills in the flight process. The invention solves the technical problem that the virtual character in the related technology can not release the fighting skill in the flight process, and improves the control flexibility of the virtual character and the playability of the game.

Description

Control method and device of virtual role, storage medium and electronic device
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for controlling a virtual character, a storage medium and an electronic device.
Background
In the related art, in a massively Multiplayer Online Role-Playing Game scene or a battle-like scene in the current market, a virtual character may fly in the scene or change a habitat topography.
In the related art, light work is common in games, but skills cannot be released in the light work process. In some flight games, a player character usually triggers skills and is mounted on a carrier, then the player character and the carrier fly in the air, only the flying direction can be controlled in the flying process, the player character cannot do other actions any more, and the player character cannot perform complete and more refined operation. In the prior art, the flight can only be carried out in the air, the player role can not do other actions in the flight process, the control granularity of the virtual role in the flight process is low, the picture is simple, and the game playing method is limited.
In view of the above problems in the related art, no effective solution has been found at present.
Disclosure of Invention
The embodiment of the invention provides a method and a device for controlling a virtual role, a storage medium and an electronic device.
According to an embodiment of the present invention, there is provided a method for controlling a virtual character, including: detecting a first light skill initiated by a first virtual character on a first environmental element of a game scene toward a second environmental element, wherein the first environmental element and the second environmental element intersect vertically in the game scene; calculating a first location parameter between the first environmental element and the second environmental element; and if the first position parameter meets a first preset condition, moving the first virtual character from the first environment element to the second environment element, and switching the game mode of the first virtual character into a fighting light power mode, wherein the fighting light power mode is used for realizing that the first virtual character simultaneously releases fighting skills in the flight process.
Optionally, the first location parameter includes a distance and an included angle, and calculating the location parameter between the first environmental element and the second environmental element includes: and calculating the minimum distance from the first environment element to the second environment element, and calculating the included angle between the surface of the first environment element and the surface of the second environment element.
Optionally, moving the first avatar from the first environment element to the second environment element includes: locating a start point location of the first light work skill on the first environmental element and a fall point location of the first light work skill on the second environmental element; generating a parabolic trajectory between the starting point position to the falling point position; configuring a motion parameter of the first virtual character based on the parabolic trajectory, wherein the motion parameter comprises an acceleration; and driving the first virtual character to fly from the starting point position to the falling point position along the parabolic track by adopting the motion parameters.
Optionally, after switching the game mode of the first virtual character to the fighting light power mode, the method further includes: detecting an attack instruction sent by the first virtual role on the second environment element aiming at a second virtual role; and after the first virtual character is controlled to move towards the direction of the second virtual character by a preset distance, executing the attack instruction.
Optionally, after switching the game mode of the first virtual character to the fighting light power mode, the method further includes: detecting a second light skill initiated by the first virtual character on a first sub-element of the second environment element toward a second sub-element, wherein the first sub-element intersects the second sub-element in the game scene, the second environment element comprising the first sub-element and the second sub-element; calculating a second position parameter between the first sub-element and the second sub-element; if the second position parameter meets a second preset condition, playing a preset turning animation in the game scene; and after the preset turning animation is played, displaying the first virtual corner pigment on the second sub-element.
Optionally, before calculating the second position parameter between the first sub-element and the second sub-element, the method further includes: judging whether an obstacle exists between the first sub-element and the second sub-element; if an intermediate obstacle exists between the first sub-element and the second sub-element, determining that the second light skill is invalid or moving the first virtual character to the edge of the intermediate obstacle; and if no obstacle exists between the first sub-element and the second sub-element, determining and calculating a second position parameter between the first sub-element and the second sub-element.
Optionally, after switching the game mode of the first virtual character to the combat ready mode, the method includes: switching the skill list of the first virtual character from a first skill set to a second skill set, wherein the first skill set is a skill set used by the first virtual character on the first environment element and the second skill set is a skill set used by the first virtual character on the second environment element; detecting a target combat skill selected by the first virtual character in the second skill set while the first virtual character is flying over the second environmental element; releasing the target fighting skill on the second environmental element.
Optionally, after switching the game mode of the first virtual character to the fighting light power mode, the method further includes: acquiring the orientation of the first virtual character; if the orientation is directed to the first environment element, controlling the virtual camera to move to a first position between the first virtual character and the first environment element; and if the orientation direction points to the second environment element, controlling the virtual camera to move to a second position between the first virtual role and the second environment element.
Optionally, after moving the first avatar from the first environment element to the second environment element, the method further includes: switching a world coordinate system of the first virtual character in the game scene from a first coordinate system to a second coordinate system, wherein the first coordinate system comprises an X axis and a Y axis, and the second coordinate system comprises an X axis and a Z axis.
According to another embodiment of the present invention, there is provided a control apparatus of a virtual character, including: a first detection module to detect a first light skill initiated by a first virtual character on a first environmental element of a game scene toward a second environmental element, wherein the first environmental element and the second environmental element intersect vertically in the game scene; a first computing module to compute a first location parameter between the first environmental element and the second environmental element; the first control module is configured to move the first virtual character from the first environment element to the second environment element if the first location parameter meets a first preset condition, and switch a game mode of the first virtual character to a fighting light power mode, where the fighting light power mode is used to enable the first virtual character to release fighting skills simultaneously in a flight process.
Optionally, the first position parameter includes a distance and an included angle, and the first calculating module includes: and the calculating unit is used for calculating the minimum distance from the first environment element to the second environment element and calculating the included angle between the surface where the first environment element is located and the surface where the second environment element is located.
Optionally, the first control module includes: a positioning unit for positioning a start point location of the first light work skill on the first environmental element and a fall point location of the first light work skill on the second environmental element; a generating unit for generating a parabolic trajectory from the starting point position to the falling point position; a configuration unit, configured to configure a motion parameter of the first virtual character based on the parabolic trajectory, wherein the motion parameter includes an acceleration; and the driving unit is used for driving the first virtual character to fly to the drop point position from the starting point position along the parabolic track by adopting the motion parameters.
Optionally, the apparatus further comprises: a first detection module, configured to detect an attack instruction sent by the first virtual character on the second environment element for a second virtual character after the first control module switches the game mode of the first virtual character to a fighting light power mode; and the execution module is used for controlling the first virtual character to execute the attack instruction after moving towards the direction of the second virtual character by a preset distance.
Optionally, the apparatus further comprises: a second detection module, configured to detect a second light work skill initiated by the first virtual character on a first sub-element of the second environment element toward a second sub-element after the first control module switches the game mode of the first virtual character to the fighting light work mode, wherein the first sub-element intersects with the second sub-element in the game scene, and the second environment element includes the first sub-element and the second sub-element; a second calculation module for calculating a second position parameter between the first sub-element and the second sub-element; the playing module is used for playing a preset turning animation in the game scene if the second position parameter meets a second preset condition; and the display module is used for displaying the first virtual corner pigment on the second sub-element after the preset turning animation is played.
Optionally, the apparatus further comprises: a determining module, configured to determine whether an obstacle exists between the first sub-element and the second sub-element before the second calculating module calculates the second position parameter between the first sub-element and the second sub-element; a determining module, configured to determine that the second light skill is invalid or move the first virtual character to an edge of an intermediate obstacle if the intermediate obstacle exists between the first sub-element and the second sub-element; and if no obstacle exists between the first sub-element and the second sub-element, determining and calculating a second position parameter between the first sub-element and the second sub-element.
Optionally, the apparatus further comprises: a switching module, configured to switch a skill list of the first virtual character from a first skill set to a second skill set after the first control module switches the game mode of the first virtual character to a fighting light power mode, where the first skill set is a skill set used by the first virtual character on the first environment element, and the second skill set is a skill set used by the first virtual character on the second environment element; a third detection module to detect a target combat skill selected by the first avatar in the second skill set while the first avatar is flying over the second environmental element; a release module to release the target fighting skill on the second environmental element.
Optionally, the apparatus further comprises: an obtaining module, configured to obtain an orientation of the first virtual character after the first control module switches the game mode of the first virtual character to a fighting light power mode; a second control module, configured to control the virtual camera to move to a first position between the first virtual character and the first environment element if the orientation is directed to the first environment element; and if the orientation direction points to the second environment element, controlling the virtual camera to move to a second position between the first virtual role and the second environment element.
Optionally, the apparatus further comprises: a switching module, configured to switch a world coordinate system of the first virtual character in the game scene from a first coordinate system to a second coordinate system after the first control module moves the first virtual character from the first environment element to the second environment element, where the first coordinate system includes an X axis and a Y axis, and the second coordinate system includes an X axis and a Z axis.
According to a further embodiment of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
By the method, the first light skill initiated by the first virtual character on the first environment element of the game scene towards the second environment element is detected, wherein the first environment element and the second environment element are vertically intersected in the game scene; calculating a first location parameter between the first environmental element and the second environmental element; if the first position parameter meets a first preset condition, the first virtual character is moved from the first environment element to the second environment element, and the game mode of the first virtual character is switched to a fighting light power mode, wherein the fighting light power mode is used for realizing that the first virtual character simultaneously releases fighting skills in the flight process, and the fighting light power mode is introduced, so that the virtual character can release the skills and move randomly in the flight process, the technical problem that the virtual character in the related technology cannot release the fighting skills in the flight process is solved, and the control flexibility of the virtual character and the game playability are improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a block diagram of a hardware configuration of a control computer of a virtual character according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a control method of a virtual character according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an embodiment of the present invention for generating a parabolic trajectory;
FIG. 4 is a schematic diagram of an embodiment of the present invention controlling a virtual camera;
fig. 5 is a block diagram of a control apparatus of a virtual character according to an embodiment of the present invention;
fig. 6 is a block diagram of an electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
The method provided by the first embodiment of the present application may be executed in a mobile phone, a tablet, a server, a computer, or a similar electronic terminal. Taking the example of running on a computer, fig. 1 is a block diagram of a hardware structure of a control computer of a virtual role according to an embodiment of the present invention. As shown in fig. 1, the computer may include one or more (only one shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and optionally, atransmission device 106 for communication functions and an input-output device 108. It will be appreciated by those of ordinary skill in the art that the configuration shown in FIG. 1 is illustrative only and is not intended to limit the configuration of the computer described above. For example, a computer may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 can be used for storing computer programs, for example, software programs and modules of application software, such as a computer program corresponding to the control method of the virtual character in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, so as to implement the above-mentioned method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to a computer through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. In the present embodiment, the processor 104 is configured to control the target virtual character to perform a specified operation to complete the game task in response to the human-machine interaction instruction and the game policy. The memory 104 is used for storing program scripts of the electronic game, configuration information, attribute information of the virtual character, and the like.
Thetransmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer. In one example, thetransmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, thetransmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
Optionally, the input/output device 108 further includes a human-computer interaction screen for acquiring a human-computer interaction instruction through a human-computer interaction interface and for presenting a picture in a virtual scene;
in this embodiment, a method for controlling a virtual character is provided, and fig. 2 is a schematic flowchart of a method for controlling a virtual character according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, detecting a first light skill initiated by a first virtual character on a first environment element of a game scene towards a second environment element, wherein the first environment element and the second environment element are vertically intersected in the game scene;
optionally, the virtual scene applied in this embodiment may be a virtual game scene, a virtual teaching scene, a virtual demonstration scene, and the like, where the virtual scene includes a plurality of virtual characters (e.g., a first virtual Character, a second virtual Character, and the like in this embodiment), and the virtual characters may be Controlled by a user operation or a system AI and move in the virtual scene such as the game scene, where the virtual characters may be Controlled by a user, such as a PCC (Player-Controlled Character) in a virtual game Controlled by a master Player. In this embodiment, a virtual scene is taken as an example of a game scene.
In this embodiment, the game scene includes a plurality of types of environment elements, such as a ground surface, a wall surface, a vegetation, a water system, etc., and a plurality of environment elements form a complex game scene ecology, some environment elements extend in a horizontal plane of the game world, some extend in a vertical direction, and intersect vertically in the game scene, such as the wall surface is perpendicular to the ground surface.
When a first virtual character moves on a flat ground, if a first light work skill is triggered, firstly calculating the distance and the angle between a climbing object (such as a wall, a house, a tree and other second environment elements) and the first virtual character, judging whether the light work execution condition is met, if so, moving the first virtual character to the climbing object based on the light work flight direction and angle, if not, allowing climbing, automatically converting into a flat ground jumping action or in-situ immobilization, and failing to release the first light work skill.
Step S204, calculating a first position parameter between the first environment element and the second environment element;
optionally, the first location parameter is used to characterize a location relationship between the first environmental element and the second environmental element.
Step S206, if the first position parameter meets a first preset condition, the first virtual character is moved from the first environment element to the second environment element, and the game mode of the first virtual character is switched to a fighting light power mode, wherein the fighting light power mode is used for realizing that the first virtual character simultaneously releases fighting skills in the flight process.
Optionally, the game mode of the first virtual character includes a plurality of game modes, which respectively correspond to different character states or positions, for example, the game mode includes a fighting light power mode and a default mode, and in the default mode, the first virtual character cannot release fighting skills in a flight process, that is, only can fly or release the fighting skills.
In this embodiment, in the light power fighting mode, besides the "eaves and walk on the wall", the "grass flying", "floating on the water", "stepping on the tree for helping" and the like can be realized, in the above process, the first virtual character can fight because the light power is not flying, but cannot hover in the air for a long time (can fly for a short time), and a supporting point, such as a wall surface, a grass tip, a water surface and the like, is required, and this supporting point refers to the second environmental element which is vertically intersected with the second environmental element in the game scene in this embodiment.
Through the steps, detecting a first light skill initiated by a first virtual character on a first environment element of a game scene towards a second environment element, wherein the first environment element and the second environment element are vertically intersected in the game scene; calculating a first location parameter between the first environmental element and the second environmental element; if the first position parameter meets a first preset condition, the first virtual character is moved from the first environment element to the second environment element, and the game mode of the first virtual character is switched to a fighting light power mode, wherein the fighting light power mode is used for realizing that the first virtual character simultaneously releases fighting skills in the flight process, and the fighting light power mode is introduced, so that the virtual character can release the skills and move randomly in the flight process, the technical problem that the virtual character in the related technology cannot release the fighting skills in the flight process is solved, and the control flexibility of the virtual character and the game playability are improved.
In this embodiment, the first location parameter includes a distance and an included angle, and the calculating the location parameter between the first environment element and the second environment element includes: and calculating the minimum distance from the first environment element to the second environment element, and calculating the included angle between the plane of the first environment element and the plane of the second environment element.
In one implementation of this embodiment, moving the first avatar from the first environment element to the second environment element includes:
s11, locating a start point location of the first light work skill on the first environmental element, and locating a fall point location of the first light work skill on the second environmental element;
optionally, the starting point position is a position of the first virtual character on the first environment element when the first light work skill is triggered, and the falling point position is a pointing position of the first light work skill on the second environment element, such as a pointing position of a release arrow of the first light work skill, and is also related to parameters of a flight distance, a flight height, a flight trajectory, a flight angle, and the like of the first light work skill.
S12, generating a parabolic track from the starting point position to the falling point position;
in this embodiment, the parabolic trajectory is connected between the first environmental element and the second environmental element. The parabolic trajectory of the present embodiment is a special parabolic trajectory, and in some upward flying scenes, includes an upward initial velocity component, and the height of the falling point position is higher than the starting point position.
S13, configuring motion parameters of the first virtual character based on the parabolic track, wherein the motion parameters comprise acceleration;
optionally, the motion parameters include an initial velocity and a maximum velocity in addition to the acceleration, and configuring the motion parameters of the first virtual character based on the parabolic trajectory includes: calculate parabola trace respectively with first environmental element and second environmental element's first contained angle and second contained angle, based on first contained angle configuration initial velocity (initial velocity is positive correlation with first contained angle, 0 degree < first contained angle < 90 degrees), configure maximum speed (maximum velocity is negative correlation with the second contained angle, 0 degree < second contained angle < 90 degrees) based on the second contained angle to and dispose the acceleration based on parabola trace's camber (when parabola trace camber changes, can calculate the maximum camber, perhaps calculate average camber), the camber is big more, the change of speed is big more, the acceleration is big more, otherwise, the acceleration is little.
The maximum speed may be a speed of the first virtual character at the drop point position, or a speed at a position in the middle of the parabolic track, and may be set according to a visual effect of the light skill, for example, the plunging light skill may set the maximum speed at the drop point position, and the light skill may set the maximum speed at the middle position.
Fig. 3 is a schematic diagram of generating a parabolic track according to an embodiment of the present invention, where the first environment element is a ground surface, the plane of the xy axis is a wall surface or a wall body, the plane of the xz axis is a point a is a starting point position, the point B is a falling point position, α is a first included angle, which is an included angle between a tangent line of the parabolic track at the point a and a normal line, and β is a second included angle, which is an included angle between a tangent line of the parabolic track at the point B and the normal line.
In this embodiment, the motion parameters are configuration parameters of a motion engine in the game scene, the motion engine being used to control the movement of each element in the game scene, such as the first virtual character.
And S14, driving the first virtual character to fly from the starting point position to the falling point position along the parabolic track by adopting the motion parameters.
In some examples, after switching the game mode of the first virtual character to the fighting ready mode, further comprising: detecting an attack instruction sent by the first virtual role on the second environment element aiming at the second virtual role; and after the first virtual character is controlled to move towards the direction of the second virtual character by a preset distance, executing an attack instruction.
The second avatar may be on the same second environment element as the first avatar, or on a different environment element, such as a wall attacking a second avatar on the ground, and a wall attacking another second avatar on a wall.
In this example, a parabolic track is presented in the process of performing light work, the parabolic track adds displacement acceleration of an X axis and a Y axis to a character according to the current light work state, in order to enable aerial combat to have controllability and make up for natural disadvantages of aerial combat in a combat light work mode, a displacement compensation mechanism is added, when a first virtual character releases a close combat attack instruction to a target character (a second virtual character), the first virtual character executes the attack instruction after moving a short distance to a target attack point before the skill is released, namely moving the first virtual character in the direction of the second virtual character by a preset distance, for a persistent attack instruction, the attack skill can be released while moving in the direction of the second virtual character, and the movement end time is the skill end time. In other examples, when the first virtual character releases the remote attack instruction to the target character (second virtual character), the first virtual character is controlled to move a preset distance in the opposite direction of the second virtual character, then the attack instruction is executed, for the persistent attack instruction, the attack skill can be released while moving away from the second virtual character, and the movement end time is the skill termination time. Thereby combining light work flight in the fighting light work mode with fighting skill direction.
In one embodiment of this embodiment, after switching the game mode of the first virtual character to the fighting ready mode, the method further includes:
s21, detecting a second light skill initiated by the first virtual character on a first sub-element of a second environment element towards the second sub-element, wherein the first sub-element intersects the second sub-element in the game scene, and the second environment element comprises the first sub-element and the second sub-element;
s22, calculating a second position parameter between the first sub-element and the second sub-element;
in some examples, before calculating the second location parameter between the first sub-element and the second sub-element, further comprising: judging whether an obstacle exists between the first sub-element and the second sub-element; if an intermediate barrier exists between the first sub-element and the second sub-element, determining that the second light skill is invalid or moving the first virtual character to the edge of the intermediate barrier; and if no obstacle exists between the first sub-element and the second sub-element, determining and calculating a second position parameter between the first sub-element and the second sub-element.
S23, if the second position parameter meets a second preset condition, playing a preset turning animation in the game scene;
and S24, displaying the first virtual corner pigment on the second sub-element after the preset turning animation is played.
In some scenes, taking the first sub-element and the second sub-element as two wall surfaces respectively as an example, when a first virtual character flies and jumps between the two wall surfaces at a certain angle, an empty turning animation is set, if the player character jumps between the two wall surfaces, firstly, the moving direction of the player character and whether an obstacle exists on a moving route are judged, if no obstacle exists, a special effect is triggered, a section of preset turning animation is played, and after the playing is finished, the player character is switched to the wall surface where a destination is located.
In one embodiment of this embodiment, after switching the game mode of the first virtual character to the fighting ready mode, the method further includes: switching the skill list of the first virtual character from a first skill set to a second skill set, wherein the first skill set is a skill set used by the first virtual character on the first environment element, and the second skill set is a skill set used by the first virtual character on the second environment element; detecting a target combat skill selected by the first virtual character in the second skill set while the first virtual character is flying over the second environmental element; releasing the target fighting skill on the second environmental element.
When the first virtual character triggers the fighting light power mode on the climbing object, in order to guarantee the visual effect of the skills, the releasable skill types of the player are limited, such as the skills which can not be released in a large range, such as AOE (Area of effect), and the like, or the skill effects released in the fighting light power mode are reconfigured. Or add some skills, i.e. a second set of skills, that are only applicable for release on the wall.
Optionally, after the game mode of the first virtual character is switched to the fighting light power mode, the method further includes: acquiring the orientation of the first virtual character; if the orientation is directed to the first environment element, controlling the virtual camera to move to a first position between the first virtual character and the first environment element; and if the orientation direction points to the second environment element, controlling the virtual camera to move to a second position between the first virtual character and the second environment element.
Specifically, the virtual camera is controlled to move from between the first avatar and the first environmental element to a second position between the first avatar and the second environmental element.
Fig. 4 is a schematic diagram of controlling a virtual camera according to an embodiment of the present invention, where the first environment element is a ground surface, the xy axis is a plane, the second environment element is a wall surface or a wall body, the orientation of the first virtual character points to the second environment element in the xz axis plane, and the virtual camera is disposed between the first virtual character and the second environment element.
Optionally, after moving the first avatar from the first environment element to the second environment element, the method further includes: the world coordinate system of the first virtual character in the game scene is switched from a first coordinate system to a second coordinate system, wherein the first coordinate system comprises an X axis and a Y axis, and the second coordinate system comprises an X axis and a Z axis.
In order to ensure the normal visual angle, the real climbing is simulated, the world coordinate system where the first virtual character is located and the virtual camera are controlled, if the first virtual character is in a 'cornice wall-walking' state, the two-dimensional coordinate system where the first virtual character is located is switched from XY to XZ, the position and the direction of the virtual camera are switched according to the current orientation of the first virtual character, so that the visual angle of the first virtual character in the flying process is controlled, the real wall climbing feeling is simulated, if a player faces the ground or a wall corner, the virtual camera is arranged on the connecting line of the first virtual character and the ground, and if the player faces the wall or the wall, the virtual camera is arranged on the connecting line of the first virtual character and the wall, and the angle between the virtual camera and the wall is arranged at the same time, so that the visual effect of overlooking or looking up is realized, and the transparent transmission effect of characters or environmental elements is avoided.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
In this embodiment, a control device for a virtual character is further provided, which is used to implement the foregoing embodiments and preferred embodiments, and the description that has been already made is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 5 is a block diagram of a control apparatus for a virtual character according to an embodiment of the present invention, as shown in fig. 5, the apparatus including: a first detection module 50, a first calculation module 52, a first control module 54, wherein,
a first detection module 50 configured to detect a first light skill initiated by a first virtual character on a first environmental element of a game scene toward a second environmental element, wherein the first environmental element and the second environmental element intersect vertically in the game scene;
a first calculation module 52 for calculating a first location parameter between the first environmental element and the second environmental element;
the first control module 54 is configured to, if the first location parameter meets a first preset condition, move the first virtual character from the first environment element to the second environment element, and switch a game mode of the first virtual character to a fighting light power mode, where the fighting light power mode is used to enable the first virtual character to release fighting skills simultaneously in a flight process.
Optionally, the first position parameter includes a distance and an included angle, and the first calculating module includes: and the calculating unit is used for calculating the minimum distance from the first environment element to the second environment element and calculating the included angle between the surface where the first environment element is located and the surface where the second environment element is located.
Optionally, the first control module includes: a positioning unit for positioning a start point location of the first light work skill on the first environmental element and a fall point location of the first light work skill on the second environmental element; a generating unit for generating a parabolic trajectory from the starting point position to the falling point position; a configuration unit, configured to configure a motion parameter of the first virtual character based on the parabolic trajectory, wherein the motion parameter includes an acceleration; and the driving unit is used for driving the first virtual character to fly to the drop point position from the starting point position along the parabolic track by adopting the motion parameters.
Optionally, the apparatus further comprises: a first detection module, configured to detect an attack instruction sent by the first virtual character on the second environment element for a second virtual character after the first control module switches the game mode of the first virtual character to a fighting light power mode; and the execution module is used for controlling the first virtual character to execute the attack instruction after moving towards the direction of the second virtual character by a preset distance.
Optionally, the apparatus further comprises: a second detection module, configured to detect a second light work skill initiated by the first virtual character on a first sub-element of the second environment element toward a second sub-element after the first control module switches the game mode of the first virtual character to the fighting light work mode, wherein the first sub-element intersects with the second sub-element in the game scene, and the second environment element includes the first sub-element and the second sub-element; a second calculation module for calculating a second position parameter between the first sub-element and the second sub-element; the playing module is used for playing a preset turning animation in the game scene if the second position parameter meets a second preset condition; and the display module is used for displaying the first virtual corner pigment on the second sub-element after the preset turning animation is played.
Optionally, the apparatus further comprises: a determining module, configured to determine whether an obstacle exists between the first sub-element and the second sub-element before the second calculating module calculates the second position parameter between the first sub-element and the second sub-element; a determining module, configured to determine that the second light skill is invalid or move the first virtual character to an edge of an intermediate obstacle if the intermediate obstacle exists between the first sub-element and the second sub-element; and if no obstacle exists between the first sub-element and the second sub-element, determining and calculating a second position parameter between the first sub-element and the second sub-element.
Optionally, the apparatus further comprises: a switching module, configured to switch a skill list of the first virtual character from a first skill set to a second skill set after the first control module switches the game mode of the first virtual character to a fighting light power mode, where the first skill set is a skill set used by the first virtual character on the first environment element, and the second skill set is a skill set used by the first virtual character on the second environment element; a third detection module to detect a target combat skill selected by the first avatar in the second skill set while the first avatar is flying over the second environmental element; a release module to release the target fighting skill on the second environmental element.
Optionally, the apparatus further comprises: an obtaining module, configured to obtain an orientation of the first virtual character after the first control module switches the game mode of the first virtual character to a fighting light power mode; a second control module, configured to control the virtual camera to move to a first position between the first virtual character and the first environment element if the orientation is directed to the first environment element; and if the orientation direction points to the second environment element, controlling the virtual camera to move to a second position between the first virtual role and the second environment element.
Optionally, the apparatus further comprises: a switching module, configured to switch a world coordinate system of the first virtual character in the game scene from a first coordinate system to a second coordinate system after the first control module moves the first virtual character from the first environment element to the second environment element, where the first coordinate system includes an X axis and a Y axis, and the second coordinate system includes an X axis and a Z axis.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Example 3
Fig. 6 is a structural diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 6, the electronic device includes aprocessor 61, acommunication interface 62, amemory 63, and acommunication bus 64, where theprocessor 61, thecommunication interface 62, and thememory 63 complete mutual communication through thecommunication bus 64, and thememory 63 is used for storing a computer program;
theprocessor 61 is configured to implement the following steps when executing the program stored in the memory 63: detecting a first light skill initiated by a first virtual character on a first environmental element of a game scene toward a second environmental element, wherein the first environmental element and the second environmental element intersect vertically in the game scene; calculating a first location parameter between the first environmental element and the second environmental element; and if the first position parameter meets a first preset condition, moving the first virtual character from the first environment element to the second environment element, and switching the game mode of the first virtual character into a fighting light power mode, wherein the fighting light power mode is used for realizing that the first virtual character simultaneously releases fighting skills in the flight process.
Optionally, the first location parameter includes a distance and an included angle, and calculating the location parameter between the first environmental element and the second environmental element includes: and calculating the minimum distance from the first environment element to the second environment element, and calculating the included angle between the surface of the first environment element and the surface of the second environment element.
Optionally, moving the first avatar from the first environment element to the second environment element includes: locating a start point location of the first light work skill on the first environmental element and a fall point location of the first light work skill on the second environmental element; generating a parabolic trajectory between the starting point position to the falling point position; configuring a motion parameter of the first virtual character based on the parabolic trajectory, wherein the motion parameter comprises an acceleration; and driving the first virtual character to fly from the starting point position to the falling point position along the parabolic track by adopting the motion parameters.
Optionally, after switching the game mode of the first virtual character to the fighting light power mode, the method further includes: detecting an attack instruction sent by the first virtual role on the second environment element aiming at a second virtual role; and after the first virtual character is controlled to move towards the direction of the second virtual character by a preset distance, executing the attack instruction.
Optionally, after switching the game mode of the first virtual character to the fighting light power mode, the method further includes: detecting a second light skill initiated by the first virtual character on a first sub-element of the second environment element toward a second sub-element, wherein the first sub-element intersects the second sub-element in the game scene, the second environment element comprising the first sub-element and the second sub-element; calculating a second position parameter between the first sub-element and the second sub-element; if the second position parameter meets a second preset condition, playing a preset turning animation in the game scene; and after the preset turning animation is played, displaying the first virtual corner pigment on the second sub-element.
Optionally, before calculating the second position parameter between the first sub-element and the second sub-element, the method further includes: judging whether an obstacle exists between the first sub-element and the second sub-element; if an intermediate obstacle exists between the first sub-element and the second sub-element, determining that the second light skill is invalid or moving the first virtual character to the edge of the intermediate obstacle; and if no obstacle exists between the first sub-element and the second sub-element, determining and calculating a second position parameter between the first sub-element and the second sub-element.
Optionally, after switching the game mode of the first virtual character to the combat ready mode, the method includes: switching the skill list of the first virtual character from a first skill set to a second skill set, wherein the first skill set is a skill set used by the first virtual character on the first environment element and the second skill set is a skill set used by the first virtual character on the second environment element; detecting a target combat skill selected by the first virtual character in the second skill set while the first virtual character is flying over the second environmental element; releasing the target fighting skill on the second environmental element.
Optionally, after switching the game mode of the first virtual character to the fighting light power mode, the method further includes: acquiring the orientation of the first virtual character; if the orientation is directed to the first environment element, controlling the virtual camera to move to a first position between the first virtual character and the first environment element; and if the orientation direction points to the second environment element, controlling the virtual camera to move to a second position between the first virtual role and the second environment element.
Optionally, after moving the first avatar from the first environment element to the second environment element, the method further includes: switching a world coordinate system of the first virtual character in the game scene from a first coordinate system to a second coordinate system, wherein the first coordinate system comprises an X axis and a Y axis, and the second coordinate system comprises an X axis and a Z axis.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In another embodiment provided by the present application, a computer-readable storage medium is further provided, in which instructions are stored, and when the instructions are executed on a computer, the computer is caused to execute the control method of the virtual character described in any one of the above embodiments.
In another embodiment provided by the present application, there is also provided a computer program product containing instructions, which when run on a computer, causes the computer to execute the method for controlling a virtual character according to any one of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (12)

CN202111101619.8A2021-09-182021-09-18Virtual character control method and device, storage medium and electronic deviceActiveCN113769406B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202111101619.8ACN113769406B (en)2021-09-182021-09-18Virtual character control method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202111101619.8ACN113769406B (en)2021-09-182021-09-18Virtual character control method and device, storage medium and electronic device

Publications (2)

Publication NumberPublication Date
CN113769406Atrue CN113769406A (en)2021-12-10
CN113769406B CN113769406B (en)2024-07-02

Family

ID=78852310

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202111101619.8AActiveCN113769406B (en)2021-09-182021-09-18Virtual character control method and device, storage medium and electronic device

Country Status (1)

CountryLink
CN (1)CN113769406B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114288660A (en)*2021-12-292022-04-08上海完美时空软件有限公司 Flight control method and device for virtual character, storage medium, and electronic device
CN114699768A (en)*2022-03-222022-07-05广州博冠信息科技有限公司Information processing method and device in game, storage medium and electronic equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20070129148A1 (en)*2005-10-142007-06-07Leviathan Entertainment, LlcMethod and System for Allocating Resources in a Video Game
US20070129126A1 (en)*2005-10-142007-06-07Leviathan Entertainment, LlcMethod and System for Allocating Resources in a Video Game
US20110230258A1 (en)*2010-03-162011-09-22Andrew Van LucheneComputer Controlled Video Game Incorporating Constraints
CN104225917A (en)*2013-06-062014-12-24苏州蜗牛数字科技股份有限公司3D swordsman fighting method based on online game
CN109701273A (en)*2019-01-162019-05-03腾讯科技(北京)有限公司Processing method, device, electronic equipment and the readable storage medium storing program for executing of game data
CN110433488A (en)*2019-08-162019-11-12腾讯科技(深圳)有限公司Battle control method, device, equipment and medium based on virtual role
CN111111192A (en)*2019-12-272020-05-08珠海金山网络游戏科技有限公司Game role moving method and device
CN112370781A (en)*2020-11-302021-02-19腾讯科技(深圳)有限公司Operation control method and apparatus, storage medium, and electronic device
CN112370787A (en)*2020-11-172021-02-19网易(杭州)网络有限公司Control method of virtual role, computer readable storage medium and processor

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20070129148A1 (en)*2005-10-142007-06-07Leviathan Entertainment, LlcMethod and System for Allocating Resources in a Video Game
US20070129126A1 (en)*2005-10-142007-06-07Leviathan Entertainment, LlcMethod and System for Allocating Resources in a Video Game
US20110230258A1 (en)*2010-03-162011-09-22Andrew Van LucheneComputer Controlled Video Game Incorporating Constraints
CN104225917A (en)*2013-06-062014-12-24苏州蜗牛数字科技股份有限公司3D swordsman fighting method based on online game
CN109701273A (en)*2019-01-162019-05-03腾讯科技(北京)有限公司Processing method, device, electronic equipment and the readable storage medium storing program for executing of game data
CN110433488A (en)*2019-08-162019-11-12腾讯科技(深圳)有限公司Battle control method, device, equipment and medium based on virtual role
CN111111192A (en)*2019-12-272020-05-08珠海金山网络游戏科技有限公司Game role moving method and device
CN112370787A (en)*2020-11-172021-02-19网易(杭州)网络有限公司Control method of virtual role, computer readable storage medium and processor
CN112370781A (en)*2020-11-302021-02-19腾讯科技(深圳)有限公司Operation control method and apparatus, storage medium, and electronic device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114288660A (en)*2021-12-292022-04-08上海完美时空软件有限公司 Flight control method and device for virtual character, storage medium, and electronic device
CN114699768A (en)*2022-03-222022-07-05广州博冠信息科技有限公司Information processing method and device in game, storage medium and electronic equipment
CN114699768B (en)*2022-03-222025-06-13广州博冠信息科技有限公司 Information processing method and device in game, storage medium, and electronic device

Also Published As

Publication numberPublication date
CN113769406B (en)2024-07-02

Similar Documents

PublicationPublication DateTitle
CN112691377B (en)Control method and device of virtual role, electronic equipment and storage medium
KR102665665B1 (en) Method and apparatus for displaying virtual environment pictures, devices, and storage media
JP7427728B2 (en) Virtual object control method, device, computer device and program thereof
JP7331124B2 (en) Virtual object control method, device, terminal and storage medium
JP2022539289A (en) VIRTUAL OBJECT AIMING METHOD, APPARATUS AND PROGRAM
CN112717407B (en)Virtual object control method, device, terminal and storage medium
CN113244608A (en)Control method and device of virtual object and electronic equipment
TWI821779B (en)Virtual object controlling method, device, computer apparatus, and storage medium
CN113769406B (en)Virtual character control method and device, storage medium and electronic device
CN113018862B (en)Virtual object control method and device, electronic equipment and storage medium
US20230078340A1 (en)Virtual object control method and apparatus, electronic device, storage medium, and computer program product
JP7589348B2 (en) Method, device, equipment, and program for displaying a screen in a virtual scene
US12409386B2 (en)Displaying visual field picture based on interaction zone on a virtual map
JP7740775B2 (en) Virtual object control method, device, equipment, and computer program
CN114225418A (en) Flight control method and device for game character, storage medium, and electronic device
CN113559515A (en)Object control method and device, storage medium and electronic equipment
JP2025515447A (en) Method, device, equipment, and computer program for displaying capture information based on a virtual world
CN114288660A (en) Flight control method and device for virtual character, storage medium, and electronic device
CN115554699A (en)In-game information processing method and device and electronic equipment
CN107050848B (en)Somatosensory game implementation method and device based on body area network
CN116920368A (en) Control methods, devices, equipment, storage media and program products for virtual objects
WO2024244678A1 (en)Interaction method and apparatus in virtual scenario, and electronic device, computer-readable storage medium and computer program product
WO2024027292A1 (en)Interaction method and apparatus in virtual scene, electronic device, computer-readable storage medium, and computer program product
CN118698121A (en) Virtual scene switching method, device, electronic device, medium and product
WO2024250823A1 (en)Virtual object control method and apparatus, device, storage medium, and program product

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp