Bullet special effect processing method and device, electronic equipment and computer readable medium
Patent Information
- Application Number
- CN202211176561.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-26
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2042-09-26
AI Technical Summary
因此,只要物理实体子弹存在于场景中,就会有较大的性能消耗
[0043] In the bullet effect processing method of this exemplary embodiment, the bullet type of the virtual bullet is determined based on the launch point and target point when the virtual bullet is fired. If it is a physical bullet, a bullet entity corresponding to the physical bullet is created, and the physical bullet effect bound to the bullet entity is played when the physical bullet is fired. If it is a performance bullet, a performance bullet effect corresponding to the performance bullet is generated, and the performance bullet effect is played according to the bullet flight parameters of the performance bullet. The bullet effect processing method in this exemplary embodiment divides virtual bullets into two types based on the position of the launch point and target point: one is a physical bullet that attracts more attention from the current player, and the other is a performance bullet that attracts less attention. For physical bullets, a bullet entity is created according to normal logic, and the physical bullet effect bound to the bullet entity is played. For performance bullets, the bullet entity and other logic that consumes a lot of resources are removed, and the corresponding performance bullet effect is played directly to purely represent the launch and flight of the bullet. The display and disappearance of the performance bullet are controlled by the logic calculation of the performance bullet effect, so that the performance bullet is as close as possible to the physical bullet in appearance, while also reducing performance consumption. This ensures that bullets with high visibility perform normally, while minimizing the performance consumption of bullets with low visibility, and also meets the performance requirements of a wide range of combat scenarios.
Smart Images

Figure CN115738272B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of game technology, and more specifically, to a method for processing bullet effects, a device for processing bullet effects, an electronic device, and a computer-readable medium. Background Technology
[0002] For shooting games such as FPS (First-person shooting game), bullets are an important game element, including their visual effects and damage triggering.
[0003] In these types of games, physical bullets require real-time collision calculations every frame after firing. If a collision occurs, damage is triggered. Therefore, the mere presence of physical bullets in the scene results in significant performance overhead. This is especially true for PVE (Player versus Environment) FPS games, where the number of monsters and characters on screen is high, leading to a greater proportion of bullets and thus a larger performance drain.
[0004] Therefore, there is an urgent need in the field for a method to process bullet effects that can reduce the performance loss caused by bullets.
[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0006] The purpose of this disclosure is to provide a method for processing bullet effects, a device for processing bullet effects, an electronic device, and a computer-readable medium, thereby reducing the performance loss caused by bullets to at least a certain extent.
[0007] According to the first aspect of this disclosure, a method for processing bullet effects is provided, comprising:
[0008] In response to the firing event of a virtual bullet in the game, obtain the firing point and target point of the virtual bullet;
[0009] The bullet type of the virtual bullet is determined based on the launch point and target point of the virtual bullet, wherein the bullet type includes physical bullets and performance bullets;
[0010] If the bullet type of the virtual bullet is the physical bullet, then a bullet entity corresponding to the physical bullet is created, and when the physical bullet is fired, the physical bullet effect bound to the bullet entity is played.
[0011] If the virtual bullet's bullet type is the performance bullet, then the performance bullet effect corresponding to the performance bullet is generated, and the performance bullet effect is played according to the performance bullet's bullet flight parameters.
[0012] In one exemplary embodiment of this disclosure, determining the bullet type of the virtual bullet based on the firing point and target point of the virtual bullet includes:
[0013] Obtain the distance between the target virtual character in the game and the launch point of the virtual bullet;
[0014] If the distance between the target virtual character and the firing point of the virtual bullet is less than or equal to a distance threshold, then the bullet type of the virtual bullet is determined to be the physical bullet.
[0015] If the distance between the target virtual character and the firing point of the virtual bullet is greater than the distance threshold, the bullet type of the virtual bullet is determined based on the target point of the virtual bullet.
[0016] In one exemplary embodiment of this disclosure, determining the bullet type of the virtual bullet based on the target point of the virtual bullet includes:
[0017] If the target point of the virtual bullet is the target virtual character, then the bullet type of the virtual bullet is determined to be the physical bullet;
[0018] If the target of the virtual bullet is another virtual character in the game, then the bullet type of the virtual bullet is determined to be the performance bullet;
[0019] If the target point of the virtual bullet is empty, the bullet type of the virtual bullet is determined according to the firing direction of the virtual bullet.
[0020] In one exemplary embodiment of this disclosure, determining the bullet type of the virtual bullet based on its firing direction includes:
[0021] Based on the position information of the target virtual character and the position information corresponding to the firing point of the virtual bullet, a first direction vector between the target virtual character and the firing point of the virtual bullet is obtained;
[0022] The second direction vector is obtained based on the firing direction of the virtual bullet, and the direction parameters of the virtual bullet are obtained based on the first direction vector and the second direction vector.
[0023] If the direction parameter of the virtual bullet is less than or equal to the direction parameter threshold, then the bullet type of the virtual bullet is determined to be the physical bullet.
[0024] If the direction parameter of the virtual bullet is greater than the direction parameter threshold, then the bullet type of the virtual bullet is determined to be the performance bullet.
[0025] In one exemplary embodiment of this disclosure, generating the performance bullet effect corresponding to the performance bullet includes:
[0026] The special effect flight speed is determined based on the flight speed of the virtual bullet, and the special effect of the performance bullet corresponding to the performance bullet is generated based on the special effect flight speed.
[0027] In one exemplary embodiment of this disclosure, playing the performance bullet effect according to the bullet flight parameters of the performance bullet includes:
[0028] The flight time and direction of the performance bullet are determined based on its launch point and target point, and the performance bullet effects are played based on its flight time and direction.
[0029] In one exemplary embodiment of this disclosure, determining the flight time and flight direction of the performance bullet based on its launch point and target point includes:
[0030] The firing distance and flight direction of the demonstration bullet are determined based on the firing point and target point of the demonstration bullet;
[0031] The flight time of the performance bullet is obtained based on the firing distance and the flight speed of the performance bullet.
[0032] In one exemplary embodiment of this disclosure, the method further includes:
[0033] If the virtual bullet is of the performance bullet type, then the hit information of the target of the performance bullet is obtained through the game server;
[0034] If the hit information is obtained, the hit effect of the shooting target will be played while the bullet effect of the performance is stopped.
[0035] According to a second aspect of this disclosure, a bullet effect processing device is provided, comprising:
[0036] The firing event response module is used to respond to the firing event of virtual bullets in the game and obtain the firing point and target point of the virtual bullets;
[0037] A bullet type determination module is used to determine the bullet type of the virtual bullet based on the launch point and target point of the virtual bullet, wherein the bullet type includes physical bullets and performance bullets;
[0038] The entity effects playback module is used to create a bullet entity corresponding to the physical bullet if the bullet type of the virtual bullet is the physical bullet, and play the physical bullet effects bound to the bullet entity when the physical bullet is fired.
[0039] The performance effects playback module is used to generate performance bullet effects corresponding to the performance bullet if the bullet type of the virtual bullet is the performance bullet, and to play the performance bullet effects according to the bullet flight parameters of the performance bullet.
[0040] According to a third aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the bullet effect processing method described in any of the preceding claims by executing the executable instructions.
[0041] According to a fourth aspect of this disclosure, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the bullet effect processing method described in any one of the preceding claims.
[0042] The exemplary embodiments disclosed herein can have the following beneficial effects:
[0043] In the bullet effect processing method of this exemplary embodiment, the bullet type of the virtual bullet is determined based on the launch point and target point when the virtual bullet is fired. If it is a physical bullet, a bullet entity corresponding to the physical bullet is created, and the physical bullet effect bound to the bullet entity is played when the physical bullet is fired. If it is a performance bullet, a performance bullet effect corresponding to the performance bullet is generated, and the performance bullet effect is played according to the bullet flight parameters of the performance bullet. The bullet effect processing method in this exemplary embodiment divides virtual bullets into two types based on the position of the launch point and target point: one is a physical bullet that attracts more attention from the current player, and the other is a performance bullet that attracts less attention. For physical bullets, a bullet entity is created according to normal logic, and the physical bullet effect bound to the bullet entity is played. For performance bullets, the bullet entity and other logic that consumes a lot of resources are removed, and the corresponding performance bullet effect is played directly to purely represent the launch and flight of the bullet. The display and disappearance of the performance bullet are controlled by the logic calculation of the performance bullet effect, so that the performance bullet is as close as possible to the physical bullet in appearance, while also reducing performance consumption. This ensures that bullets with high visibility perform normally, while minimizing the performance consumption of bullets with low visibility, and also meets the performance requirements of a wide range of combat scenarios.
[0044] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0045] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0046] Figure 1 A schematic diagram of an exemplary system architecture for a bullet effect processing method and apparatus applicable to embodiments of the present invention is shown;
[0047] Figure 2 A flowchart illustrating a bullet effect processing method according to an exemplary embodiment of this disclosure is shown.
[0048] Figure 3 A schematic diagram of the process for determining the bullet type based on the launch point and target point of a virtual bullet is shown in an exemplary embodiment of this disclosure;
[0049] Figure 4 A flowchart illustrating a sample implementation of this disclosure is shown, illustrating the process of further determining the bullet type based on the target point of a virtual bullet.
[0050] Figure 5 A flowchart illustrating a sample embodiment of this disclosure is shown, illustrating the process of further determining the bullet type based on the firing direction of a virtual bullet.
[0051] Figure 6 A flowchart illustrating a method for processing bullet effects according to a specific embodiment of the present disclosure is shown.
[0052] Figure 7 A block diagram of a bullet effect processing apparatus according to an exemplary embodiment of the present disclosure is shown;
[0053] Figure 8 A schematic diagram of the structure of a computer system suitable for implementing the embodiments of the present disclosure is shown. Detailed Implementation
[0054] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0055] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0056] Figure 1 A schematic diagram of the system architecture of an exemplary application environment in which a bullet effect processing method and apparatus according to embodiments of the present invention can be applied is shown.
[0057] like Figure 1 As shown, system architecture 100 may include multiple mobile terminals 101, 102, and 103, a network 104, and a server 105. Network 104 serves as a medium for providing communication links between mobile terminals 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wireless communication links.
[0058] It should be understood that Figure 1 The number of mobile terminals, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of mobile terminals, networks, and servers can be included. For example, server 105 could be a server cluster consisting of multiple servers.
[0059] Mobile terminals 101, 102, and 103 can be various electronic devices with processors, including but not limited to smartphones, tablets, laptops, etc. Server 105 can be a server providing various services. For example, mobile terminals 101, 102, and 103 can respond to the firing event of virtual bullets in the game through their processors, obtain the firing point and target point of the virtual bullets, and upload them to server 105. Server 105 can determine the bullet type of the virtual bullet based on the firing point and target point, generate corresponding bullet effects, and play the bullet effects on mobile terminals 101, 102, and 103.
[0060] For FPS games, the presence of a large number of physical bullets in the game scene often leads to significant performance consumption. Therefore, reducing bullet consumption is an important step in optimizing performance.
[0061] In some related embodiments, a distance threshold can be set for the bullet. When the distance between the bullet and the player exceeds this threshold, the update frequency is reduced, thereby reducing consumption. When the distance is below the threshold, the update frequency is restored.
[0062] However, the bullet calculation logic remains intact in the above method, resulting in significant resource consumption during updates. Furthermore, simply defining a condition to reduce the update frequency will still revert to high-frequency updates when low-attention bullets fly in from a distance, causing unnecessary resource consumption. For distant bullets, the reduced frequency leads to slower updates in position, effects, and other visual aspects, causing bullet display to become choppy and making players more aware of abnormal bullet behavior.
[0063] In other related embodiments, bullets at a distance can be directly hidden, eliminating all computational logic. However, this approach may not meet the desired visual effects and cannot satisfy the demands of rich and intense combat scenarios.
[0064] To address the aforementioned issues, this example implementation first provides a method for processing bullet effects. (Reference) Figure 2 As shown, the above bullet effect processing method may include the following steps:
[0065] Step S210. In response to the firing event of a virtual bullet in the game, obtain the firing point and target point of the virtual bullet.
[0066] Step S220. Determine the bullet type of the virtual bullet based on the launch point and target point of the virtual bullet, wherein the bullet type includes physical bullets and performance bullets.
[0067] Step S230. If the bullet type of the virtual bullet is a physical bullet, then create a bullet entity corresponding to the physical bullet, and play the physical bullet effect bound to the bullet entity when the physical bullet is fired.
[0068] Step S240. If the virtual bullet's bullet type is a performance bullet, then generate the performance bullet effect corresponding to the performance bullet, and play the performance bullet effect according to the performance bullet's bullet flight parameters.
[0069] In the bullet effect processing method of this exemplary embodiment, the bullet type of the virtual bullet is determined based on the launch point and target point when the virtual bullet is fired. If it is a physical bullet, a bullet entity corresponding to the physical bullet is created, and the physical bullet effect bound to the bullet entity is played when the physical bullet is fired. If it is a performance bullet, a performance bullet effect corresponding to the performance bullet is generated, and the performance bullet effect is played according to the bullet flight parameters of the performance bullet. The bullet effect processing method in this exemplary embodiment divides virtual bullets into two types based on the position of the launch point and target point: one is a physical bullet that attracts more attention from the current player, and the other is a performance bullet that attracts less attention. For physical bullets, a bullet entity is created according to normal logic, and the physical bullet effect bound to the bullet entity is played. For performance bullets, the bullet entity and other logic that consumes a lot of resources are removed, and the corresponding performance bullet effect is played directly to purely represent the launch and flight of the bullet. The display and disappearance of the performance bullet are controlled by the logic calculation of the performance bullet effect, so that the performance bullet is as close as possible to the physical bullet in appearance, while also reducing performance consumption. This ensures that bullets with high visibility perform normally, while minimizing the performance consumption of bullets with low visibility, and also meets the performance requirements of a wide range of combat scenarios.
[0070] Below, in conjunction with Figures 3 to 5 The steps described above in this example implementation will be explained in more detail.
[0071] In step S210, in response to the firing event of a virtual bullet in the game, the firing point and target point of the virtual bullet are obtained.
[0072] In this example implementation, virtual bullets refer to bullets fired by game characters using virtual weapons. Generally, in a game scene, after a virtual bullet is fired, it will be displayed as a physical bullet with bullet effects. When it hits an object or game character in the game scene, it will produce a hit effect and cause damage.
[0073] In this example implementation, in response to the firing event of a virtual bullet in the game, the location information of the firing point and target point of the virtual bullet is obtained before the virtual bullet is fired, and the type of virtual bullet is determined.
[0074] In step S220, the bullet type of the virtual bullet is determined based on the launch point and target point of the virtual bullet, wherein the bullet type includes physical bullets and performance bullets.
[0075] For current gamers, some virtual bullets in games attract more attention than others. Based on the launch and target points of the virtual bullets, it can be determined whether the virtual bullet is worth the player's attention, thus classifying it as either a physical bullet or a performance bullet.
[0076] In this example implementation, virtual bullets with high attention can be identified as physical bullets, while virtual bullets with low attention can be identified as performance bullets. For example... Figure 3 As shown, determining the bullet type of a virtual bullet based on its launch point and target point can specifically include the following steps:
[0077] Step S310. Obtain the distance between the target virtual character in the game and the firing point of the virtual bullet.
[0078] Based on the current location of the player's target virtual character in the game and the location of the virtual bullet's firing point, the distance between the target virtual character and the virtual bullet's firing point can be obtained.
[0079] Step S320. If the distance between the target virtual character and the firing point of the virtual bullet is less than or equal to the distance threshold, then the bullet type of the virtual bullet is determined to be a physical bullet.
[0080] If the distance between the target virtual character and the firing point of the virtual bullet is less than or equal to the distance threshold, it means that the virtual bullet is close to the current player character and is something the current player needs to pay attention to. Therefore, it can be directly identified as a physical bullet.
[0081] The distance threshold can be configured based on the device model of the virtual weapon in the game and the current game scene. For example, for low-end devices, the distance can be shorter.
[0082] Step S330. If the distance between the target virtual character and the firing point of the virtual bullet is greater than the distance threshold, then determine the bullet type of the virtual bullet based on the target point of the virtual bullet.
[0083] If the distance between the target virtual character and the firing point of the virtual bullet is greater than the distance threshold, it means that the virtual bullet is far away from the current player character and needs to be further determined on a case-by-case basis.
[0084] In this example implementation, as Figure 4 As shown, determining the bullet type of a virtual bullet based on its target point can specifically include the following steps:
[0085] Step S410. If the target point of the virtual bullet is the target virtual character, then the bullet type of the virtual bullet is determined to be a physical bullet.
[0086] If the target of the virtual bullet is the virtual character corresponding to the current player, then the virtual bullet is what the current player needs to focus on, and therefore it can be directly identified as a physical bullet.
[0087] Step S420. If the target of the virtual bullet is another virtual character in the game, then the bullet type of the virtual bullet is determined to be a performance bullet.
[0088] If the virtual bullet's target is another virtual character in the game, then it doesn't need to concern the current player, and therefore it's classified as a performance bullet.
[0089] Step S430. If the target point of the virtual bullet is empty, determine the bullet type of the virtual bullet according to the firing direction of the virtual bullet.
[0090] If the virtual bullet launcher has no target and only the direction in which the bullet is launched, then further determination is needed based on the launch direction of the virtual bullet.
[0091] In this example implementation, as Figure 5 As shown, determining the bullet type of a virtual bullet based on its firing direction can involve the following steps:
[0092] Step S510. Based on the position information of the target virtual character and the position information corresponding to the firing point of the virtual bullet, obtain the first direction vector between the target virtual character and the firing point of the virtual bullet.
[0093] Based on the position information of the target virtual character and the position information corresponding to the launch point of the virtual bullet, such as coordinate information, the first direction vector DirA between the target virtual character and the launch point of the virtual bullet can be calculated.
[0094] Step S520. Obtain the second direction vector based on the firing direction of the virtual bullet, and obtain the direction parameters of the virtual bullet based on the first direction vector and the second direction vector.
[0095] The second direction vector DirB can be obtained from the firing direction of the virtual bullet. Then, the direction parameter result of the virtual bullet can be obtained from the first direction vector DirA and the second direction vector DirB, where result = DirA * DirB.
[0096] Step S530. If the direction parameter of the virtual bullet is less than or equal to the direction parameter threshold, then the bullet type of the virtual bullet is determined to be a physical bullet.
[0097] If the direction parameter result of the virtual bullet is less than or equal to the direction parameter threshold, for example, result is less than or equal to cos30°, then the bullet type of the virtual bullet is determined to be a physical bullet.
[0098] Step S540. If the direction parameter of the virtual bullet is greater than the direction parameter threshold, then the bullet type of the virtual bullet is determined to be a performance bullet.
[0099] If the direction parameter result of the virtual bullet is greater than the direction parameter threshold, for example, result is greater than cos30°, then the bullet type of the virtual bullet is determined to be a performance bullet.
[0100] In step S230, if the bullet type of the virtual bullet is a physical bullet, a bullet entity corresponding to the physical bullet is created, and when the physical bullet is fired, the physical bullet effect bound to the bullet entity is played.
[0101] In this example implementation, for a physical bullet, a corresponding bullet entity needs to be created, and when the physical bullet is fired, a physical bullet effect bound to the bullet entity is played. The physical bullet effect is a static trailing effect that can be bound to the bullet entity and change with the bullet's position.
[0102] The disappearance of a physical bullet is based on two conditions: it disappears upon colliding with an object, or it disappears after existing for a set time.
[0103] In step S240, if the virtual bullet's bullet type is a performance bullet, then the performance bullet effect corresponding to the performance bullet is generated, and the performance bullet effect is played according to the performance bullet's bullet flight parameters.
[0104] In this example implementation, since there is no actual bullet, the bullet flight process needs to be simulated through bullet effects. Therefore, a speed-based flight effect needs to be generated based on the trailing effect as the performance bullet effect.
[0105] In this example implementation, the flight speed of the special effect can be determined based on the flight speed of the virtual bullet, and the performance bullet effect corresponding to the performance bullet can be generated based on the flight speed of the special effect. That is, the flight speed of the performance bullet effect is set to be equal to the flight speed of the virtual bullet. After generating the performance bullet effect, the performance bullet effect can be played according to the bullet flight parameters, where the bullet flight parameters may include the bullet's flight time and flight direction.
[0106] In this example implementation, the flight time and direction of the performance bullet can be determined based on the launch point and target point of the performance bullet, and the performance bullet special effects can be played based on the flight time and direction of the performance bullet.
[0107] Specifically, the firing distance and flight direction of the performance bullet can be determined based on the firing point and target point, and then the flight time of the performance bullet can be obtained based on the firing distance and flight speed of the performance bullet.
[0108] Since the performance bullets lack collision detection, the lifespan of the effects needs to be dynamically set to control their destruction and ensure they don't pass through the target character, resulting in unrealistic visuals. Assuming all bullets hit the target, the performance bullet's flight time T = (target position – launch position) / flight speed. A maximum bullet lifespan also needs to be set.
[0109] Additionally, the trajectory of the performance bullet is calculated as: target position – launch position. Once the flight time and trajectory of the performance bullet are determined, the performance bullet effect can be played, and the performance bullet can be launched.
[0110] In this example implementation, if the virtual bullet's bullet type is a performance bullet, the hit information of the target being shot by the performance bullet can be obtained through the game server. If the hit information is obtained, the hit effect of the target being shot will be played while the performance bullet effect is stopped.
[0111] Since collisions cannot be calculated locally, the performance bullets can obtain the hit information of the target they are shooting at through the game server, and notify the local target whether it has been hit. If it has been hit, the corresponding hit effect will be played while the performance bullet effects are stopped.
[0112] like Figure 6 The diagram shown is a complete flowchart of a specific embodiment of this disclosure, illustrating the steps described above in this example embodiment. The specific steps of the flowchart are as follows:
[0113] Step S610. Determine if it is a low-attention bullet.
[0114] When firing a bullet, the first step is to determine if it's a low-attention bullet. This is done by first assessing the distance between the bullet's launch point and the current player character, along with a corresponding distance threshold. If the bullet is fired from a nearby location, it warrants attention; if it's fired from a distance, further assessment is needed. For bullets fired from a distance, if the target is the current player character, it warrants attention; if the target is another character, it doesn't need attention; if there's no target, further assessment is required. For bullets with no target but a firing direction, the first direction vector DirA between the current player character and the launch point is calculated. Then, the bullet's firing direction DirB is determined, and the direction parameter result = DirA * DirB is calculated. If result > cos30°, it's a low-attention bullet; otherwise, it's not.
[0115] If it is not a low-attention bullet, proceed to step S620; if it is a low-attention bullet, proceed to step S630.
[0116] Step S620. Fire the physical bullet.
[0117] For physical bullets, a bullet entity is created, and a bullet effect following the entity is played. The physical bullet's collision information is calculated every frame, and a hit effect is played when it strikes a target. Firing physical bullets incurs significant performance overhead.
[0118] Step S630. Fire the demonstration bullet.
[0119] Specifically, step S630 may include the following steps:
[0120] Step S6301. Select the flight effect corresponding to the performance bullet.
[0121] Based on the trailing effect, create corresponding bullet effects for the performance and configure them with the same flight speed as the bullets.
[0122] Step S6302. Calculate the special effects flight time.
[0123] The flight time T corresponding to the special effects of the bullet is T = (target position – launch position) / flight speed.
[0124] Step S6303. Calculate the special effect flight direction.
[0125] The trajectory of the special effects bullet in the performance = target position – launch position.
[0126] Step S6304. Play the bullet effect performance.
[0127] Step S6305. Determine whether the target character has been hit.
[0128] The game server retrieves information about the targets hit by the bullets and notifies the local machine.
[0129] Step S6306. Play the hit effect.
[0130] If a hit notification is received from a target character, the corresponding hit effect will play. Firing performance bullets consumes relatively little performance.
[0131] It should be noted that although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0132] Furthermore, this disclosure also provides a processing device for bullet effects. (See reference) Figure 7 As shown, the bullet effect processing device may include a firing event response module 710, a bullet type determination module 720, a physical effect playback module 730, and a performance effect playback module 740. Wherein:
[0133] The firing event response module 710 can be used to respond to the firing event of virtual bullets in the game and obtain the firing point and target point of the virtual bullets;
[0134] The bullet type determination module 720 can be used to determine the bullet type of a virtual bullet based on the launch point and target point of the virtual bullet, wherein the bullet type includes physical bullets and performance bullets;
[0135] The entity effects playback module 730 can be used to create a bullet entity corresponding to the physical bullet if the bullet type of the virtual bullet is a physical bullet, and play the physical bullet effects bound to the bullet entity when the physical bullet is fired.
[0136] The performance effects playback module 740 can be used to generate performance bullet effects corresponding to the performance bullet if the bullet type of the virtual bullet is a performance bullet, and play the performance bullet effects according to the bullet flight parameters of the performance bullet.
[0137] In some exemplary embodiments of this disclosure, the bullet type determination module 720 may include a bullet distance determination unit, a first physical bullet determination unit, and a first bullet type determination unit. Wherein:
[0138] The bullet distance determination unit can be used to obtain the distance between the target virtual character and the firing point of the virtual bullet in the game;
[0139] The first physical bullet determination unit can be used to determine the bullet type of the virtual bullet as a physical bullet if the distance between the target virtual character and the firing point of the virtual bullet is less than or equal to a distance threshold.
[0140] The first bullet type determination unit can be used to determine the bullet type of the virtual bullet based on the target point of the virtual bullet if the distance between the target virtual character and the firing point of the virtual bullet is greater than a distance threshold.
[0141] In some exemplary embodiments of this disclosure, the first bullet type determination unit may include a second physical bullet determination unit, a first performance bullet determination unit, and a second bullet type determination unit. Wherein:
[0142] The second physical bullet determination unit can be used to determine the bullet type of the virtual bullet as a physical bullet if the target point of the virtual bullet is the target virtual character.
[0143] The first performance bullet determination unit can be used to determine the bullet type of the virtual bullet as a performance bullet if the target point of the virtual bullet is another virtual character in the game.
[0144] The second bullet type determination unit can be used to determine the bullet type of a virtual bullet based on its firing direction if the target point of the virtual bullet is empty.
[0145] In some exemplary embodiments of this disclosure, the second bullet type determination unit may include a first direction vector determination unit, a direction parameter determination unit, a third physical bullet determination unit, and a second performance bullet determination unit. Wherein:
[0146] The first direction vector determination unit can be used to obtain the first direction vector between the target virtual character and the firing point of the virtual bullet based on the position information of the target virtual character and the position information corresponding to the firing point of the virtual bullet.
[0147] The direction parameter determination unit can be used to obtain a second direction vector based on the firing direction of the virtual bullet, and to obtain the direction parameters of the virtual bullet based on the first direction vector and the second direction vector;
[0148] The third entity bullet determination unit can be used to determine the bullet type of the virtual bullet as an entity bullet if the direction parameter of the virtual bullet is less than or equal to the direction parameter threshold.
[0149] The second performance bullet determination unit can be used to determine the bullet type of the virtual bullet as a performance bullet if the direction parameter of the virtual bullet is greater than the direction parameter threshold.
[0150] In some exemplary embodiments of this disclosure, the performance effects playback module 740 may include a performance bullet effect generation unit, which can be used to determine the effect flight speed according to the flight speed of the virtual bullet, and generate the performance bullet effect corresponding to the performance bullet according to the effect flight speed.
[0151] In some exemplary embodiments of this disclosure, the performance effects playback module 740 may further include a flight parameter determination unit, which can be used to determine the flight time and flight direction of the performance bullet based on the launch point and target point of the performance bullet, and play the performance bullet effects based on the flight time and flight direction of the performance bullet.
[0152] In some exemplary embodiments of this disclosure, the flight parameter determination unit may include a flight direction determination unit and a flight time determination unit. Wherein:
[0153] The flight direction determination unit can be used to determine the firing distance and flight direction of the demonstration bullet based on the firing point and target point of the demonstration bullet;
[0154] The flight time determination unit can be used to determine the flight time of the demonstration bullet based on its firing distance and flight speed.
[0155] In some exemplary embodiments of this disclosure, the bullet effect processing apparatus provided in this disclosure may further include a hit effect playback module, which may include a hit information acquisition unit and a hit effect playback unit. Wherein:
[0156] The hit information acquisition unit can be used to acquire the hit information of the shooting target of the performance bullet through the game server if the bullet type of the virtual bullet is a performance bullet.
[0157] The hit effect playback unit can be used to play the hit effect of the shooting target while stopping the playback of the bullet effect if hit information is obtained.
[0158] The specific details of each module / unit in the aforementioned bullet effect processing device have been described in detail in the corresponding method embodiment section, and will not be repeated here.
[0159] Figure 8 A schematic diagram of a computer system suitable for implementing embodiments of the present invention is shown.
[0160] It should be noted that, Figure 8 The computer system 800 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0161] like Figure 8As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 802 or programs loaded from storage section 808 into random access memory (RAM) 803. The RAM 803 also stores various programs and data required for system operation. The CPU 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0162] The following components are connected to I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to I / O interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 810 as needed so that computer programs read from it can be installed into storage section 808 as needed.
[0163] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by central processing unit (CPU) 801, it performs various functions defined in the system of this application.
[0164] It should be noted that the computer-readable medium disclosed herein may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0165] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0166] In another aspect, this application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to perform the methods described in the above embodiments.
[0167] It should be noted that although several modules for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules described above can be embodied in one module. Conversely, the features and functions of one module described above can be further divided and embodied by multiple modules.
[0168] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein.
[0169] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A method for processing bullet special effects, characterized in that, include: In response to the firing event of a virtual bullet in the game, obtain the firing point and target point of the virtual bullet; The bullet type of the virtual bullet is determined based on its launch point and target point, wherein the bullet type includes physical bullets and performance bullets; the determination of the bullet type based on the launch point and target point includes: obtaining the distance between the target virtual character in the game and the launch point of the virtual bullet; if the distance between the target virtual character and the launch point of the virtual bullet is less than or equal to a distance threshold, then the bullet type of the virtual bullet is determined to be a physical bullet; if the distance between the target virtual character and the launch point of the virtual bullet is greater than the distance threshold, then the bullet type of the virtual bullet is determined based on the target point of the virtual bullet. Type; If the target point of the virtual bullet is empty, then based on the position information of the target virtual character and the position information corresponding to the launch point of the virtual bullet, a first direction vector between the target virtual character and the launch point of the virtual bullet is obtained; a second direction vector is obtained based on the launch direction of the virtual bullet, and the direction parameter of the virtual bullet is obtained based on the first direction vector and the second direction vector; if the direction parameter of the virtual bullet is less than or equal to the direction parameter threshold, then the bullet type of the virtual bullet is determined to be the physical bullet; if the direction parameter of the virtual bullet is greater than the direction parameter threshold, then the bullet type of the virtual bullet is determined to be the performance bullet; If the bullet type of the virtual bullet is the physical bullet, then a bullet entity corresponding to the physical bullet is created, and when the physical bullet is fired, the physical bullet effect bound to the bullet entity is played. If the virtual bullet's bullet type is the performance bullet, then a performance bullet effect corresponding to the performance bullet is generated, and the performance bullet effect is played according to the bullet flight parameters of the performance bullet. The flight speed of the performance bullet effect is set to be equal to the flight speed of the virtual bullet. The hit information of the target of the performance bullet is obtained through the game server. If the hit information is obtained, the hit effect of the target is played while the performance bullet effect is stopped. The bullet flight parameters include the flight time and flight direction of the performance bullet. The flight time of the performance bullet is determined according to the launch distance and flight speed of the performance bullet, and the maximum bullet survival time of the performance bullet is set.
2. The bullet effect processing method according to claim 1, characterized in that, Determining the bullet type of the virtual bullet based on its target point includes: If the target point of the virtual bullet is the target virtual character, then the bullet type of the virtual bullet is determined to be the physical bullet; If the target of the virtual bullet is another virtual character in the game, then the bullet type of the virtual bullet is determined to be the performance bullet; If the target point of the virtual bullet is empty, the bullet type of the virtual bullet is determined according to the firing direction of the virtual bullet.
3. The bullet effect processing method according to claim 1, characterized in that, The generation of the performance bullet effect corresponding to the performance bullet includes: The special effect flight speed is determined based on the flight speed of the virtual bullet, and the special effect of the performance bullet corresponding to the performance bullet is generated based on the special effect flight speed.
4. The bullet effect processing method according to claim 1, characterized in that, The step of playing the performance bullet effects based on the bullet flight parameters of the performance bullet includes: The flight time and direction of the performance bullet are determined based on its launch point and target point, and the performance bullet effects are played based on its flight time and direction.
5. The bullet effect processing method according to claim 4, characterized in that, Determining the flight time and direction of the demonstration bullet based on its launch point and target point includes: The firing distance and flight direction of the demonstration bullet are determined based on the firing point and target point of the demonstration bullet; The flight time of the performance bullet is obtained based on the firing distance and the flight speed of the performance bullet.
6. A bullet effect processing device, characterized in that, include: The firing event response module is used to respond to the firing event of virtual bullets in the game and obtain the firing point and target point of the virtual bullets; A bullet type determination module is used to determine the bullet type of a virtual bullet based on its launch point and target point, wherein the bullet type includes physical bullets and performance bullets; the step of determining the bullet type of a virtual bullet based on its launch point and target point includes: obtaining the distance between the target virtual character in the game and the launch point of the virtual bullet; if the distance between the target virtual character and the launch point of the virtual bullet is less than or equal to a distance threshold, then the bullet type of the virtual bullet is determined to be a physical bullet; if the distance between the target virtual character and the launch point of the virtual bullet is greater than the distance threshold, then the bullet type of the virtual bullet is determined to be a physical bullet based on the target point of the virtual bullet. The virtual bullet's bullet type is determined as follows: If the target point of the virtual bullet is empty, a first direction vector between the target virtual character and the launch point of the virtual bullet is obtained based on the position information of the target virtual character and the position information corresponding to the launch point of the virtual bullet; a second direction vector is obtained based on the launch direction of the virtual bullet, and the direction parameter of the virtual bullet is obtained based on the first direction vector and the second direction vector; if the direction parameter of the virtual bullet is less than or equal to a direction parameter threshold, the bullet type of the virtual bullet is determined to be the physical bullet; if the direction parameter of the virtual bullet is greater than the direction parameter threshold, the bullet type of the virtual bullet is determined to be the performance bullet. The entity effects playback module is used to create a bullet entity corresponding to the physical bullet if the bullet type of the virtual bullet is the physical bullet, and to play the physical bullet effects bound to the bullet entity when the physical bullet is fired. The performance effects playback module is used to generate performance bullet effects corresponding to the performance bullet if the bullet type of the virtual bullet is the performance bullet, and play the performance bullet effects according to the bullet flight parameters of the performance bullet. The flight speed of the performance bullet effects is set to be equal to the flight speed of the virtual bullet. The module obtains the hit information of the target of the performance bullet through the game server. If the hit information is obtained, the module plays the hit effect of the target while stopping the playback of the performance bullet effects. The bullet flight parameters include the flight time and flight direction of the performance bullet. The flight time of the performance bullet is determined according to the launch distance and flight speed of the performance bullet, and the module sets the maximum bullet survival time of the performance bullet.
7. An electronic device, characterized in that, include: processor; as well as A memory for storing one or more programs that, when executed by the processor, cause the processor to implement the bullet effect processing method as described in any one of claims 1 to 5.
8. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the bullet effect processing method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Virtual prop interaction method and device and electronic equipment
CN112090070A