CN112274931A - Shooting track processing method and device and electronic equipment - Google Patents

Shooting track processing method and device and electronic equipment Download PDF

Info

Publication number
CN112274931A
CN112274931A CN202011317061.2A CN202011317061A CN112274931A CN 112274931 A CN112274931 A CN 112274931A CN 202011317061 A CN202011317061 A CN 202011317061A CN 112274931 A CN112274931 A CN 112274931A
Authority
CN
China
Prior art keywords
ray
shooting
game
logic
rays
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
CN202011317061.2A
Other languages
Chinese (zh)
Other versions
CN112274931B (en
Inventor
廖向辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202011317061.2A priority Critical patent/CN112274931B/en
Publication of CN112274931A publication Critical patent/CN112274931A/en
Application granted granted Critical
Publication of CN112274931B publication Critical patent/CN112274931B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/57Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game
    • A63F13/573Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game using trajectories of game objects, e.g. of a golf ball according to the point of impact
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/80Special adaptations for executing a specific game genre or game mode
    • A63F13/837Shooting of targets

Landscapes

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

Abstract

The invention provides a shooting track processing method and device and electronic equipment. Wherein, the method comprises the following steps: triggering a shooting weapon to sequentially emit a plurality of rays in response to a shooting instruction received by the terminal equipment; adjusting the moving track of the emitted rays at preset time intervals; responding to the collision event of the target ray and the game physical component, and executing preset hit processing logic on the target ray; and displaying the processing result of the hit processing logic on the game interface. In the mode, the shooting track of a shooting weapon can be simulated through rays, the moving track of the rays can be adjusted at preset first time intervals, compared with the mode that the shooting track is simulated through physical rigid body components, the number of the rays in simulation calculation is far smaller than that of the physical rigid body components, the calculation amount of the simulation calculation can be reduced, the game resources consumed by shooting track processing are reduced, the stability of the game frame rate and the game performance are improved, and the game experience of a player can be improved.

Description

Shooting track processing method and device and electronic equipment
Technical Field
The invention relates to the technical field of shooting games, in particular to a shooting track processing method and device and electronic equipment.
Background
In order to realize the water gun function in the shooting game, the effects of flying and free falling of the water column from the muzzle at a high speed need to be simulated, and the water column needs to perform some specific logic operations (for example, playing a water splashing special effect and the like) when contacting a game scene or other players, and calculates the specific attributes of the players (for example, deducting the blood volume of the players and the like). The general realization scheme for realizing the water gun function in the existing shooting game is as follows: the water column ejected by the water gun is set into dense physical rigid body components with trailing special effects one by one, the flight of the rigid body components is physically simulated, and the logic hit by the water gun is processed when the rigid body components contact other physical game components.
In the above general implementation scheme, a large number of rigid body components are required to perform analog computation in order to ensure the continuity effect of the water column, and a large number of analog computations occupy a large number of resources of the game terminal, thereby causing instability of the game frame rate and reduction of game performance. If the hardware performance of the game terminal is not high enough (for example, the hardware performance of the mobile phone is lower than that of the computer), the running efficiency of the game is seriously reduced, and the game is jammed, so that the game experience of the player is reduced.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a shooting track processing method, a shooting track processing apparatus, and an electronic device, so as to reduce game resources consumed by shooting track processing, improve stability of a game frame rate and performance of a game, and thereby improve game experience of a player.
In a first aspect, an embodiment of the present invention provides a shooting trajectory processing method, where the method includes: triggering a shooting weapon to sequentially emit a plurality of rays in response to a shooting instruction received by the terminal equipment; adjusting the moving track of the emitted rays at preset time intervals; responding to a collision event of the target ray and a game physical component in the game scene, and executing preset hit processing logic on the target ray; the target ray is at least one ray in the emitted rays, and the game physical components at least comprise an object model and a role model in the game scene; and displaying the processing result of the hit processing logic on the game interface.
In a preferred embodiment of the present invention, the step of triggering the shooting weapon to sequentially shoot a plurality of rays in response to the shooting instruction received by the terminal device includes: responding to a shooting instruction received by the terminal equipment, and determining shooting duration; determining a firing interval for the firing weapon based on the type of the firing weapon; from the receipt of the firing instructions, the rays are fired one by one from the muzzle of the firing weapon at firing intervals until the firing duration is reached.
In a preferred embodiment of the present invention, the step of firing the radiation one by one from the muzzle of the fired weapon at each interval firing interval comprises: determining the position of a muzzle of a shooting weapon at each shooting interval; wherein the position of the muzzle comprises the height of the muzzle and the pitch angle of the muzzle; determining an initial velocity of the ray based on the type of the firing weapon; the rays are fired one by one from the muzzle of the firing weapon based on the initial velocity of the rays and the position of the muzzle of the firing weapon.
In a preferred embodiment of the present invention, the step of adjusting the moving trajectory of the emitted ray every predetermined first time interval includes: taking a preset first time length as a period, and taking the ending position of the ray in the current period as the initial position of the ray in the next period; determining the ending position and the speed parameter of the ray of the next period based on the ending position and the speed parameter of the ray of the current period; the speed parameters comprise the pitching angle of the ray, the speed of the ray and the falling force of the ray; and determining the moving track of the next cycle ray based on the initial position of the next cycle ray and the end position of the next cycle ray.
In a preferred embodiment of the present invention, the hit processing logic comprises hit special effect logic; the processing result of the hit special effect logic comprises a special effect corresponding to the hit special effect logic; the step of executing the preset hit processing logic for the target ray in response to the collision event of the target ray with the game physical component in the game scene includes: determining hit special effect logic based on the type of the game physical component in response to a collision event of the target ray with the game physical component in the game scene; the step of displaying the processing result of the hit processing logic on the game interface includes: and displaying the special effect corresponding to the hit special effect logic on the game interface.
In a preferred embodiment of the present invention, the hit processing logic further includes role attribute logic; the role attribute logic represents the attribute change of the role model; the step of executing the preset hit processing logic for the target ray in response to the collision event of the target ray with the game physical component of the game physical component in the game scene includes: responding to a collision event of a target ray and the character model, executing character attribute logic based on the contact position, the type of a shooting weapon and the length of the target ray, and obtaining a change result of the character attribute logic; the step of displaying the processing result of the hit processing logic on the game interface includes: and displaying the icon identification on the game interface, and displaying the change result of the role attribute logic through the icon identification.
In a preferred embodiment of the present invention, the method further includes: sending the processing result to a server in communication connection with the terminal equipment so that the server sends the processing result to other terminal equipment; the other terminal equipment is terminal equipment for controlling the role model except the terminal equipment; or sending the processing result to other terminal equipment.
In a preferred embodiment of the invention, the shape of the radiation corresponds to the projectile of the shooting weapon.
In a second aspect, an embodiment of the present invention further provides a shooting track processing apparatus, where the apparatus includes: the ray emission module is used for responding to a shooting instruction received by the terminal equipment and triggering a shooting weapon to emit a plurality of rays in sequence; the moving track adjusting module is used for adjusting the moving track of the emitted rays at intervals of preset first time; the hit processing logic execution module is used for responding to a collision event of the target ray and a game physical component in a game scene and executing preset hit processing logic on the target ray; the target ray is at least one ray in the emitted rays, and the game physical components at least comprise an object model and a role model in the game scene; and the processing result display module is used for displaying the processing result of the hit processing logic on the game interface.
In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a processor and a memory, where the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the steps of the above-mentioned shooting trajectory processing method.
In a fourth aspect, embodiments of the present invention further provide a computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the steps of the shot trajectory processing method described above.
The embodiment of the invention has the following beneficial effects:
according to the shooting track processing method, the shooting track processing device and the electronic equipment, the terminal equipment can trigger the shooting weapon to emit the plurality of rays in sequence, the moving track of each emitted ray is adjusted at intervals of a preset first time length, and the target rays are subjected to hit processing logic after colliding with the game physical assembly. In the mode, the shooting track of a shooting weapon can be simulated through rays, the moving track of the rays can be adjusted at preset first time intervals, compared with the mode that the shooting track is simulated through physical rigid body components, the number of the rays in simulation calculation is far smaller than that of the physical rigid body components, the calculation amount of the simulation calculation can be reduced, the game resources consumed by shooting track processing are reduced, the stability of the game frame rate and the game performance are improved, and the game experience of a player can be improved.
Additional features and advantages of the disclosure will be set forth in the description which follows, or in part may be learned by the practice of the above-described techniques of the disclosure, or may be learned by practice of the disclosure.
In order to make the aforementioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a shooting trajectory processing method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another shot trajectory processing method provided by an embodiment of the invention;
FIG. 3 is a schematic diagram of a ray tracing trajectory according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a shooting trajectory processing apparatus according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of another shot trajectory processing device provided in the embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. 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 invention.
At present, in the water gun function in shooting games, water columns emitted by the water gun are generally set to be dense physical rigid body components with trailing special effects one by one, and the flight of each rigid body component is physically simulated. In order to ensure the continuity effect of the water column, a large number of rigid body components are needed for analog calculation, so that a large number of resources of a game terminal are occupied, the game frame rate is unstable, the game performance is reduced, and the game experience of a player is reduced. In summary, the simulation of a large number of physical rigid body components in the general implementation scheme may cause unstable game performance, resulting in excessive pressure on the terminal device and even failure of normal operation of the functions.
Based on this, the shooting track processing method, the shooting track processing device and the electronic equipment provided by the embodiment of the invention can be applied to equipment which can realize man-machine interaction, such as a computer, a mobile phone, a tablet personal computer and a server, and are particularly suitable for shooting game scenes.
For the convenience of understanding the embodiment, a firing trace processing method disclosed in the embodiment of the present invention will be described in detail first.
The present embodiment provides a shooting track processing method, referring to a flowchart of the shooting track processing method shown in fig. 1, where the shooting track processing method includes the following steps:
and step S102, responding to the shooting instruction received by the terminal equipment, and triggering the shooting weapon to emit a plurality of rays in sequence.
The terminal device in this embodiment may be a mobile phone, a computer, a tablet computer, a notebook computer, or other devices capable of performing human-computer interaction. The game interface is provided through the terminal device, and the display content of the game interface at least partially comprises a game scene, a character model (namely a target virtual character) controlled by the terminal device and a game physical component.
The target virtual character can be controlled by the player through the terminal equipment, and shooting operation is carried out in the target scene. The game physical components include objects within the game scene (such as various buildings in the game scene and terrains like mountains, lands, oceans) and various character models (including target virtual characters and other virtual characters controlled by other terminal devices besides the terminal devices).
The player can input a shooting instruction through the terminal equipment, wherein if the terminal equipment is a computer, the player can input the shooting instruction through equipment in communication connection with the computer, such as a keyboard, a mouse or a handle; if the terminal device is a touch device such as a mobile phone or a tablet computer, the player can input a shooting instruction by using a finger.
The terminal device may respond to the shooting instruction, and trigger the target virtual character to perform a shooting operation, that is, a shooting weapon carried by the target virtual character shoots. It should be noted here that the initial position and the initial angle at which each ray is emitted are not necessarily the same. If the above-mentioned shooting weapon has recoil or the target virtual character is in a moving state during shooting, the muzzle position of the shooting weapon at the time of shooting (i.e., the initial position at the time of ray emission) is not fixed.
And step S104, respectively adjusting the moving track of the emitted rays at intervals of preset first time length.
After the rays are emitted, the terminal equipment can adjust the moving track of the rays at intervals of presetting a first time length so as to enable the moving track of each emitted ray to accord with a physical law. For example: the shooting weapon emits a ray every 0.1 second, and after 0.3 second, the rays A, B and C are emitted, and then the moving tracks of the rays A, B and C can be respectively adjusted. The moving tracks of the ray A, the ray B and the ray C can be independently calculated, and have no influence on each other.
Step S106, responding to the collision event of the target ray and the game physical component in the game scene, and executing preset hit processing logic on the target ray; the target ray is at least one ray in the emitted rays, and the game physical components at least comprise an object model and a character model in the game scene.
The game physical components at least comprise object models and role models in the game scene, wherein the object models can comprise various buildings in the game scene and terrains such as mountains, lands, oceans and the like).
The object ray may be a transmitted ray, and the trajectory of the object ray moving in the event of a collision of the object ray with a game physical component contacts the game physical component in the game scene, for example: taking a shooting weapon as an example, the water column emitted by the target virtual character is shot to a building or other virtual characters.
The hit processing logic may include dynamic effects of the target ray's contact with the physical components of the game, such as: the water column relates to the splash effect generated on the building; the effect of the target ray hitting other virtual characters causing the attribute of other virtual characters to change can also be included, for example: and the blood volume of other virtual characters is deducted, the moving speed of other virtual characters is reduced, other virtual characters are dizzy, and the like.
And step S108, displaying the processing result of the hit processing logic on the game interface.
After the hit processing logic is executed on the target ray, a processing result of the hit processing logic may be displayed on the game interface. Specifically, if the processing result shows some special effects, the special effect result can be displayed on the game interface; if the processing result is the attribute change, the specific numerical value of the attribute phase change can be displayed on the game interface.
According to the shooting track processing method provided by the embodiment of the invention, the terminal equipment can trigger the shooting weapon to sequentially emit a plurality of rays, the moving track of each emitted ray is respectively adjusted at intervals of preset first time, and the target rays are subjected to hit processing logic after colliding with the game physical assembly. In the mode, the shooting track of a shooting weapon can be simulated through rays, the moving track of the rays can be adjusted at preset first time intervals, compared with the mode that the shooting track is simulated through physical rigid body components, the number of the rays in simulation calculation is far smaller than that of the physical rigid body components, the calculation amount of the simulation calculation can be reduced, the game resources consumed by shooting track processing are reduced, the stability of the game frame rate and the game performance are improved, and the game experience of a player can be improved.
The embodiment provides another shooting track processing method, which is implemented on the basis of the above embodiment; the present embodiment focuses on an embodiment in which a shooting weapon fires multiple rays in sequence. As shown in fig. 2, another shot trajectory processing method is a flowchart, and the shot trajectory processing method in this embodiment includes the following steps:
step S202, responding to the shooting instruction received by the terminal equipment, and determining the shooting duration.
The shooting instruction input by the user may include a shooting duration of the target virtual character, for example: a user inputs a shooting instruction in a way of long-pressing a mouse, and the time of long-pressing the mouse can be used as the shooting duration of the target virtual character; another example is: the user inputs a shooting instruction by pressing the screen with the fingers for a long time, and the time for pressing the screen with the fingers for a long time can be used as the shooting duration of the target virtual character.
In step S204, based on the type of the shooting weapon, the shooting interval of the shooting weapon is determined.
Different shooting weapons can set different shooting intervals, so that the shooting interval of the shooting weapon can be determined according to the type of the shooting weapon carried by the target virtual character. For example: the shooting interval of the pistol A can be preset to be 1 second, and the shooting interval of the rifle B can be preset to be 0.1 second; if the shooting weapon carried by the target virtual character is pistol a, the shooting interval of pistol a can be determined to be 1 second according to a preset value.
And step S206, starting from the reception of the shooting instruction, emitting rays from the muzzle of the shooting weapon one by one at every shooting interval until the shooting duration is reached.
After determining the shooting duration and the shooting interval, the terminal device may emit a plurality of rays from the muzzle of the shooting weapon, the emitting interval of each ray may be the shooting interval, and the length of each ray may be obtained by multiplying the initial velocity of the emission by the shooting interval, for example: assuming a firing interval of 0.1 second and a firing duration of 0.35 second, the firing weapon may fire 4 rays at 0 second, 0.1 second, 0.2 second and 0.3 second, respectively.
When the muzzle of the shooting weapon emits rays one by one, since the muzzle may be in a moving state due to recoil or a target virtual character, the muzzle is in a moving state consistently, and the emission situation of each ray is different, the rays can be emitted one by one from the muzzle of the shooting weapon through the steps a 1-A3:
step A1, determining the position of the muzzle of the shooting weapon at each shooting interval; wherein the position of the muzzle comprises the height of the muzzle and the pitch angle of the muzzle.
The position of the muzzle of the weapon being fired at that time can be determined prior to firing the rays. Since there is a high possibility that the muzzle of the shooting weapon shakes, resulting in a state in which both the height of the muzzle and the pitch angle of the muzzle are changed, the height of the muzzle and the pitch angle of the muzzle can be determined in advance as the position of the muzzle of the shooting weapon.
For example: the target virtual character shoots while moving, and the muzzle is shaken all the time due to the recoil of the moving and shooting weapon, and the position of the muzzle needs to be determined before each ray is shot. For another example, if the firing weapon is not recoil free and the target avatar is at rest when firing, the muzzle position may be considered fixed.
Step A2, determining an initial velocity of the ray based on the type of weapon fired.
Different shooting weapons have different initial velocities of the radiation, i.e. the firing rates of different weapons are not the same, and therefore the initial velocity of the radiation can be determined according to the type of shooting weapon.
Step A3, based on the initial velocity of the rays and the position of the muzzle of the firing weapon, the rays are fired one by one from the muzzle of the firing weapon.
The initial velocity of the ray may be understood as a scalar quantity, while the ray emitted from the muzzle may be considered as a vector whose angle to the horizontal axis may be determined from the elevation angle of the muzzle, for example: the initial speed of the ray is a, the preset first time duration is b, and the elevation angle of the muzzle (namely the angle between the muzzle and the horizontal coordinate axis) is c. The ray may be calculated by the following equation, and the length of the ray may be ab, and the vector coordinate of the ray may be (absinc, abcosc).
In the method, the position of the muzzle of the shooting weapon can be determined in advance, then the rays are emitted from the muzzle of the shooting weapon one by one according to the initial speed and the position of the muzzle of the rays, the moving track of each ray can be different, and the moving track of each ray can be accurately described through the method, so that the rays emitted by the shooting weapon are more real, and the game experience of a player is improved.
Step S208, adjusting the moving trajectory of the emitted ray every a preset first time interval.
For each emitted ray, the terminal device can adjust the track of the ray in time, however, the track of the ray is adjusted in real time, which causes a large calculation amount and occupies more game resources, so that the terminal device can adjust the moving track after the first time length is preset at intervals. The preset first duration may be the same as or different from the interval between the shooting weapons, and is not limited herein. Therefore, the moving trajectory of the ray can be adjusted by using the steps B1-B3:
and step B1, taking the preset first duration as a period, and taking the ending position of the ray in the current period as the initial position of the ray in the next period.
In the adjusting of the moving track, the adjustment may be performed in a preset first time period, for example, the first preset time period may be 0.1 second, and each period may determine the ending position, the speed parameter, and the initial position of the radial line of the period.
In the first period, the initial position of the ray is the position of the muzzle, the ending position is the vector coordinate of the ray, the pitch angle of the ray in the speed parameter can be understood as the pitch coordinate of the muzzle, and the speed of the ray is the initial speed of the ray.
Therefore, after the ending position of the ray in the current period is determined, the ending position of the ray in the current period can be used as the initial position of the ray in the next period, so that each ray is continuous, the shooting reality of the shooting weapon is increased, and the game experience of a user is improved.
Step B2, determining the ending position and the speed parameter of the ray of the next period based on the ending position and the speed parameter of the ray of the current period; wherein the speed parameters comprise the pitch angle of the ray, the speed of the ray and the falling force of the ray.
The ending position of the next period ray can be determined according to the ending position and the speed parameter of the current period ray, that is, the ending position of the current period ray is used as the initial position of the next period ray, the speed parameter of the current period ray is used as the initial speed parameter of the next period ray, and after the preset first time, the ending position and the speed parameter of the next period ray can be calculated.
And step B3, determining the moving track of the next cycle ray based on the initial position of the next cycle ray and the end position of the next cycle ray.
The initial position of the next period ray is taken as a starting point, and the technical position of the next period ray is taken as an end point, so that the moving track of the next period ray can be determined. The steps B1-B3 are repeated to obtain a complete movement trajectory of each emitted ray.
For example, a continuous multi-segment ray detection can be used to determine the collision with the scene component or the player, after the water gun starts to shoot, a ray with a corresponding length is shot from the muzzle to the shooting direction at intervals of 0.1 second (the first preset time is 0.1 second) according to the initial speed (the initial speed is influenced by the upward shooting and the downward shooting of the muzzle and is related to the distance between the muzzle and the horizontal plane), and then the tail point of the ray is still used as the initial point at intervals of 0.1 second, a ray is created at a new speed calculated according to the dropping force of the special effect and the initial speed until the ray shoots the physics in a certain game scene. And calculating the deviation of the subsequent rays as the code, wherein g is the falling force of the special effect of the particles, and calculating the initial point and the direction of the next ray detection after the deviation.
Referring to fig. 3, which is a schematic diagram of a ray moving track, fig. 3 shows a complete schematic diagram of a ray, each arrow, i.e. the moving track of the ray of the above one period, in the actual simulation, each ray is not as long as that shown in fig. 3, and each arrow does not exist simultaneously but is generated continuously until the ray reaches a game physical component, i.e. a scene object or a player.
In this way, new ray detection of the initial point and direction can be continuously generated to simulate the effect of a ray flying and falling in a scene, each ray can be sequentially emitted from the last ray end point, and participates in ray detection calculation to detect whether the ray intersects with a game scene or a player collision body or a bone bounding box, and then the logic of the hit can be processed.
In addition, it should be noted here that the terminal device may draw the movement trajectory in a particle-specific manner to achieve a flight effect of the missile, and the performance of the missile may be freely designed by a specially-skilled engineer to achieve a best effect. Different shooting weapons may correspond to different shapes of rays, such as: the shape of the ray corresponds to the projectile of the shooting weapon.
Taking the projectile as liquid or fluid as an example, the mud and the water can respectively correspond to different shapes of rays, so that the mud and the water can be displayed by adopting different particle special effects to improve the game experience of the player.
Step S210, responding to the collision event of the target ray and the game physical component in the game scene, and executing preset hit processing logic on the target ray; the target ray is at least one ray in the emitted rays, and the game physical components at least comprise an object model and a character model in the game scene.
Generally, the hit processing logic is divided into at least two parts, and the special effect displayed by the hit and the attribute change generated by the hit correspond to the hit special effect logic and the role attribute logic respectively. The hit special effect logic may be understood as that after a ray hits a game physical component, the hit special effect logic may be improved to show a special effect, and a processing result of the special effect logic includes a special effect corresponding to the hit special effect logic, for example: in response to a collision event of the target ray with a gameplay physical component in the game scene, hit special effect logic is determined based on the type of the gameplay physical component.
The target ray may determine hit special effect logic upon contact with objects and other virtual characters within the game scene. For example, if the water column of the water gun hits other virtual characters or buildings, the water splash special effect can be determined by hitting the special effect logic, and if the water column of the water gun hits the sea, the water splash special effect can not be displayed.
Role attribute logic may be understood as the change in attributes of other role models that may be caused by the target ray when it touches other virtual roles, such as: and in response to the collision event of the target ray and the character model, executing character attribute logic based on the contact position, the type of the shooting weapon and the length of the target ray to obtain a change result of the character attribute logic.
The character model here may be a character model of the above-mentioned other virtual character, or may be a character model of the target virtual character, and taking the other virtual character as an example, when the target ray is based on the other virtual character, an attribute change of the other character model may be caused, and the attribute change is related to both the type of the shooting weapon and the length of the target ray until the release. The attribute change may be a blood volume change, a defense change, a speed change, etc. of other virtual characters.
Different types of firing weapons can result in different variations in attributes, such as: the medical gun can improve the blood volume of other virtual characters, the anesthesia gun can reduce the speed of other virtual characters, some special guns can reduce the defense of other virtual characters, and the degree that different types of guns reduce the blood volume of other virtual characters is not equal.
In step S212, the processing result of the hit processing logic is displayed on the game interface.
The manner in which the processing results are displayed on the game interface is different for different hit processing logic. The processing result of the hit special effect logic comprises the special effect corresponding to the hit special effect logic, so that the special effect corresponding to the hit special effect logic can be displayed on the game interface. For example: if the processing result of the hitting special effect logic comprises the splash special effect, the splash special effect can be displayed at the contact position of the target ray and the game physical component directly.
The processing result of the character attribute logic comprises the attribute change value of the character model, namely the processing result is the change on some numerical values, so that the icon identification can be displayed on the game interface, and the change result of the character attribute logic is displayed through the icon identification.
The icon identifiers in this embodiment may be displayed around the contact positions of the target ray and other virtual characters, different attributes may be represented in different colors, and the variation of the attributes may be represented in numbers. For example: red indicates the subtraction of blood volume, green indicates the increase of blood volume, blue indicates the decrease of defense force, yellow mark movement speed, and the like.
After the terminal device determines the processing result of the hit processing logic, the processing result may be sent to other terminal devices corresponding to other virtual characters in the same game scene, for example: sending the processing result to a server in communication connection with the terminal equipment so that the server sends the processing result to other terminal equipment; the other terminal equipment is terminal equipment for controlling the role model except the terminal equipment; or sending the processing result to other terminal equipment.
The terminal device may first send the processing result to a server in communication connection with the terminal device, and the server forwards the processing result to other terminal devices, and the other terminal devices may display the processing result after receiving the processing result.
The terminal device may also directly send the processing result to another terminal device in communication connection with the terminal device, so that the other terminal device displays the processing result.
In this manner, the terminal device may generate the processing result to a terminal device that controls a role model other than the terminal device, so as to display the processing result on another terminal device, thereby implementing synchronous transmission of the processing result.
The method provided by the embodiment of the invention adopts a ray detection mode, and compared with physical collision detection, the ray detection only needs to calculate whether the ray is intersected with the corresponding collision body, does not need to calculate the intersection of the bounding boxes like each frame of physical collision, greatly improves the operation efficiency, and can operate games at a stable frame rate on a middle-low-end mobile phone, thereby improving the game experience of players.
Corresponding to the method embodiment, the embodiment of the invention provides a shooting track processing device, which provides a game interface through terminal equipment, wherein at least part of the display content of the game interface comprises a game scene, a target virtual character controlled by the terminal equipment and a game physical component; wherein the game physical components comprise objects in the game scene and other virtual characters except the target virtual character. Fig. 4 is a schematic structural diagram of a shot trajectory processing device, which includes:
the ray emission module 41 is used for responding to a shooting instruction received by the terminal device and triggering a shooting weapon to emit a plurality of rays in sequence;
a moving track adjusting module 42, configured to adjust a moving track of the emitted ray at intervals of a preset first time;
a hit processing logic executing module 43, configured to execute a preset hit processing logic on the target ray in response to a collision event between the target ray and a game physical component in the game scene; the target ray is at least one ray in the emitted rays, and the game physical components at least comprise an object model and a role model in the game scene;
and a processing result display module 44, configured to display a processing result of the hit processing logic on the game interface.
According to the shooting track processing device provided by the embodiment of the invention, the terminal equipment can trigger the shooting weapon to sequentially emit a plurality of rays, the moving track of each emitted ray is respectively adjusted at intervals of preset first time, and the target rays are subjected to hit processing logic after colliding with the game physical component. In the mode, the shooting track of a shooting weapon can be simulated through rays, the moving track of the rays can be adjusted at preset first time intervals, compared with the mode that the shooting track is simulated through physical rigid body components, the number of the rays in simulation calculation is far smaller than that of the physical rigid body components, the calculation amount of the simulation calculation can be reduced, the game resources consumed by shooting track processing are reduced, the stability of the game frame rate and the game performance are improved, and the game experience of a player can be improved.
The ray emission module is used for responding to a shooting instruction received by the terminal equipment and determining shooting duration; determining a firing interval for the firing weapon based on the type of the firing weapon; from the receipt of the firing instructions, the rays are fired one by one from the muzzle of the firing weapon at firing intervals until the firing duration is reached.
The ray emission module is used for determining the position of a muzzle of a shooting weapon at each shooting interval; wherein the position of the muzzle comprises the height of the muzzle and the pitch angle of the muzzle; determining an initial velocity of the ray based on the type of the firing weapon; the rays are fired one by one from the muzzle of the firing weapon based on the initial velocity of the rays and the position of the muzzle of the firing weapon.
The moving track adjusting module is configured to use a preset first duration as a period, and use an end position of a ray in a current period as an initial position of a ray in a next period; determining the ending position and the speed parameter of the ray of the next period based on the ending position and the speed parameter of the ray of the current period; the speed parameters comprise the pitching angle of the ray, the speed of the ray and the falling force of the ray; and determining the moving track of the next cycle ray based on the initial position of the next cycle ray and the end position of the next cycle ray.
The hit processing logic comprises hit special effect logic; the processing result of the hit special effect logic comprises a special effect corresponding to the hit special effect logic; the hit processing logic execution module is used for responding to a collision event of the target ray and a game physical component in a game scene and determining hit special effect logic based on the type of the game physical component; and the processing result display module is used for displaying the special effect corresponding to the hit special effect logic on the game interface.
The hit processing logic further comprises role attribute logic; the role attribute logic represents the attribute change of the role model; the hit processing logic execution module is used for responding to a collision event of a target ray and the role model, executing role attribute logic based on the contact position, the type of a shooting weapon and the length of the target ray and obtaining a change result of the role attribute logic; and the processing result display module is used for displaying the icon identification on the game interface and displaying the change result of the role attribute logic through the icon identification.
Referring to the schematic structural diagram of another shooting trajectory processing apparatus shown in fig. 5, the shooting trajectory processing apparatus further includes a processing result sending module 45, connected to the hit processing logic executing module 43, for sending the processing result to a server communicatively connected to the terminal device, so that the server sends the processing result to other terminal devices; the other terminal equipment is terminal equipment for controlling the role model except the terminal equipment; or sending the processing result to other terminal equipment.
The shape of the ray corresponds to the projectile of the shooting weapon.
The embodiment of the invention also provides electronic equipment for operating the shooting track processing method; referring to fig. 6, an electronic device is shown, which includes a memory 100 and a processor 101, where the memory 100 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor 101 to implement the shot trajectory processing method.
Further, the electronic device shown in fig. 6 further includes a bus 102 and a communication interface 103, and the processor 101, the communication interface 103, and the memory 100 are connected through the bus 102.
The Memory 100 may include a high-speed Random Access Memory (RAM) and may further include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used. The bus 102 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 6, but that does not indicate only one bus or one type of bus.
The processor 101 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 101. The Processor 101 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can 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. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 100, and the processor 101 reads the information in the memory 100, and completes the steps of the method of the foregoing embodiment in combination with the hardware thereof.
The embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the above-mentioned shooting trajectory processing method.
The method, the apparatus, and the computer program product of the electronic device for processing a shooting trajectory provided in the embodiments of the present invention include a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the method in the foregoing method embodiments, and specific implementation may refer to the method embodiments, and will not be described herein again.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and/or the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In addition, in the description of the embodiments of the present invention, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, an electronic device, or a network device) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (11)

1. A method of processing a firing trajectory, the method comprising:
triggering a shooting weapon to sequentially emit a plurality of rays in response to a shooting instruction received by the terminal equipment;
adjusting the moving track of the emitted ray at intervals of a preset first time length;
responding to a collision event of a target ray and a game physical component in a game scene, and executing preset hit processing logic on the target ray; the target ray is at least one ray in the emitted rays, and the game physical components at least comprise an object model and a character model in the game scene;
and displaying the processing result of the hit processing logic on a game interface.
2. The method of claim 1, wherein the step of triggering the firing weapon to fire a plurality of rays in sequence in response to a firing order received by the terminal device comprises:
responding to a shooting instruction received by the terminal equipment, and determining shooting duration;
determining a firing interval for a firing weapon based on a type of the firing weapon;
and starting from the moment of receiving the shooting instruction, emitting rays from the muzzle of the shooting weapon one by one at each interval of the shooting interval until the shooting duration is reached.
3. The method of claim 2, wherein the step of firing rays seriatim from the muzzle of the firing weapon at each firing interval comprises:
determining the position of the muzzle of the firing weapon at each firing interval; wherein the position of the muzzle comprises the height of the muzzle and the pitch angle of the muzzle;
determining an initial velocity of the ray based on the type of the firing weapon;
based on the initial velocity of the rays and the position of the muzzle of the shooting weapon, the rays are fired one by one from the muzzle of the shooting weapon.
4. The method according to claim 1, wherein the step of adjusting the moving trajectory of the emitted ray at intervals of a preset first time period comprises:
taking a preset first time length as a period, and taking the ending position of the ray in the current period as the initial position of the ray in the next period;
determining the ending position and the speed parameter of the ray in the next period based on the ending position and the speed parameter of the ray in the current period; wherein the speed parameters include a pitch angle of the ray, a speed of the ray, and a drop force of the ray;
and determining the moving track of the ray in the next period based on the initial position of the ray in the next period and the end position of the ray in the next period.
5. The method of claim 1, wherein the hit processing logic comprises hit special effects logic; the processing result of the hit special effect logic comprises a special effect corresponding to the hit special effect logic;
in response to a collision event of a target ray with a game physical component in a game scene, executing preset hit processing logic on the target ray, including:
in response to a collision event of a target ray with a gameplay physical component in a gameplay scene, determining the hit special effect logic based on a type of the gameplay physical component;
the step of displaying the processing result of the hit processing logic on a game interface includes:
and displaying the special effect corresponding to the hit special effect logic on a game interface.
6. The method of claim 1, wherein the hit processing logic further comprises role attribute logic; the role attribute logic represents the attribute change of the role model;
in response to a collision event of a target ray with a game physical component in a game scene, executing preset hit processing logic on the target ray, wherein the step comprises the following steps:
in response to a collision event of a target ray with the character model, executing the character attribute logic based on a contact position, the type of the shooting weapon and the length of the target ray to obtain a change result of the character attribute logic;
the step of displaying the processing result of the hit processing logic on a game interface includes:
and displaying an icon identifier on a game interface, and displaying a change result of the role attribute logic through the icon identifier.
7. The method of claim 1, further comprising:
sending the processing result to a server in communication connection with the terminal equipment so that the server sends the processing result to other terminal equipment; the other terminal equipment is terminal equipment which is used for controlling the role model and is except the terminal equipment;
or sending the processing result to the other terminal equipment.
8. The method of claim 1, wherein the shape of the ray corresponds to a projectile of the firing weapon.
9. A shot trajectory processing apparatus, characterized in that the apparatus comprises:
the ray emission module is used for responding to a shooting instruction received by the terminal equipment and triggering a shooting weapon to emit a plurality of rays in sequence;
the moving track adjusting module is used for adjusting the moving track of the emitted rays at intervals of preset first time;
the system comprises a hit processing logic execution module, a target ray detection module and a target ray detection module, wherein the hit processing logic execution module is used for responding to a collision event of a target ray and a game physical component in a game scene and executing preset hit processing logic on the target ray; the target ray is at least one ray in the emitted rays, and the game physical components at least comprise an object model and a character model in the game scene;
and the processing result display module is used for displaying the processing result of the hit processing logic on a game interface.
10. An electronic device comprising a processor and a memory, the memory storing computer-executable instructions executable by the processor to perform the steps of the shot trajectory processing method of any of claims 1-8.
11. A computer-readable storage medium having stored thereon computer-executable instructions that, when invoked and executed by a processor, cause the processor to perform the steps of the shot trajectory processing method of any of claims 1-8.
CN202011317061.2A 2020-11-20 2020-11-20 Shooting track processing method and device and electronic equipment Active CN112274931B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011317061.2A CN112274931B (en) 2020-11-20 2020-11-20 Shooting track processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011317061.2A CN112274931B (en) 2020-11-20 2020-11-20 Shooting track processing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN112274931A true CN112274931A (en) 2021-01-29
CN112274931B CN112274931B (en) 2024-03-22

Family

ID=74399615

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011317061.2A Active CN112274931B (en) 2020-11-20 2020-11-20 Shooting track processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112274931B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113663329A (en) * 2021-09-01 2021-11-19 腾讯科技(深圳)有限公司 Shooting control method and device for virtual character, electronic equipment and storage medium
CN113713382A (en) * 2021-09-10 2021-11-30 腾讯科技(深圳)有限公司 Virtual prop control method and device, computer equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120090216A1 (en) * 2010-10-19 2012-04-19 Danyun Li Electronic Firearm Sight and method for adjusting the reticle thereof
CN107519641A (en) * 2017-08-04 2017-12-29 网易(杭州)网络有限公司 Control method, apparatus, storage medium and the mobile terminal of game skill release
CN108635858A (en) * 2018-05-18 2018-10-12 腾讯科技(深圳)有限公司 Interface display method, device, electronic device and computer readable storage medium
CN108635857A (en) * 2018-05-18 2018-10-12 腾讯科技(深圳)有限公司 Interface display method, device, electronic device and computer readable storage medium
CN208244080U (en) * 2018-05-16 2018-12-18 广州力给动漫科技有限公司 It is a kind of can double competitive hydraulic giant shooting game machine
CN111084986A (en) * 2019-12-17 2020-05-01 腾讯科技(深圳)有限公司 Display control method, display control device, storage medium, and electronic device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120090216A1 (en) * 2010-10-19 2012-04-19 Danyun Li Electronic Firearm Sight and method for adjusting the reticle thereof
CN107519641A (en) * 2017-08-04 2017-12-29 网易(杭州)网络有限公司 Control method, apparatus, storage medium and the mobile terminal of game skill release
CN208244080U (en) * 2018-05-16 2018-12-18 广州力给动漫科技有限公司 It is a kind of can double competitive hydraulic giant shooting game machine
CN108635858A (en) * 2018-05-18 2018-10-12 腾讯科技(深圳)有限公司 Interface display method, device, electronic device and computer readable storage medium
CN108635857A (en) * 2018-05-18 2018-10-12 腾讯科技(深圳)有限公司 Interface display method, device, electronic device and computer readable storage medium
CN111084986A (en) * 2019-12-17 2020-05-01 腾讯科技(深圳)有限公司 Display control method, display control device, storage medium, and electronic device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113663329A (en) * 2021-09-01 2021-11-19 腾讯科技(深圳)有限公司 Shooting control method and device for virtual character, electronic equipment and storage medium
CN113663329B (en) * 2021-09-01 2024-04-02 腾讯科技(深圳)有限公司 Shooting control method and device for virtual character, electronic equipment and storage medium
CN113713382A (en) * 2021-09-10 2021-11-30 腾讯科技(深圳)有限公司 Virtual prop control method and device, computer equipment and storage medium
CN113713382B (en) * 2021-09-10 2023-06-16 腾讯科技(深圳)有限公司 Virtual prop control method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN112274931B (en) 2024-03-22

Similar Documents

Publication Publication Date Title
US11224815B2 (en) Method and apparatus for obtaining damage value of attack item in virtual environment, method and apparatus for displaying damage value of attack item in virtual environment, and computer device
US11826662B2 (en) Ballistic trajectory display in a virtual environment
JP6104515B2 (en) Program, information storage medium, electronic device and server system
CN111228812B (en) Virtual object control method, device, terminal and storage medium
JP3931796B2 (en) Action game control program
CN111084986B (en) Display control method, display control device, storage medium, and electronic device
CN112274931B (en) Shooting track processing method and device and electronic equipment
JP4412716B2 (en) GAME DEVICE, PROGRAM, AND INFORMATION STORAGE MEDIUM
CN111760289B (en) Method, device and equipment for controlling virtual roles in game
CN110585712A (en) Method, device, terminal and medium for throwing virtual explosives in virtual environment
CN110694279B (en) Game special effect display method, device, equipment and medium
US8777746B2 (en) Gestures to encapsulate intent
CN107998654B (en) Acceleration adjusting method and device, storage medium and electronic device
CN110639203A (en) Control response method and device in game
CN109821238A (en) Method of sight and device in game, storage medium, electronic device
TWI494151B (en) Method and system for preventing plugin in network game
WO2022156491A1 (en) Virtual object control method and apparatus, and device, storage medium and program product
CN111420392A (en) Game prop installation method and device and electronic equipment
CN112915532B (en) Information prompting method and device in game, electronic equipment and storage medium
CN112121416B (en) Control method, device, terminal and storage medium of virtual prop
CN113559505A (en) Information processing method and device in game and mobile terminal
CN112717384A (en) Information processing method and device in game, electronic equipment and storage medium
CN113599828B (en) Virtual prop control method and device, storage medium and electronic equipment
JP2017104617A (en) Program, electronic apparatus, and server system
CN113663329B (en) Shooting control method and device for virtual character, electronic equipment and storage medium

Legal Events

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