Method, device, equipment, medium and program product for using virtual gun
By designing virtual weapons that support multiple firing modes, the problem of cumbersome virtual weapon switching operations has been solved, enabling high-accuracy shooting on the same virtual weapon to adapt to different combat scenarios and simplifying the operation process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2022-03-24
- Publication Date
- 2026-07-21
AI Technical Summary
In the game, players need to obtain the configuration information after switching virtual weapons, which is cumbersome and not suitable for use in different scenarios.
Design a virtual firearm that supports multiple firing modes, including instant firing and delayed firing. Switching between different hit rates is achieved by changing the state of the virtual hammer, avoiding tedious configuration and viewing.
It enables multiple combat scenarios to be handled on the same virtual weapon, improving the hit rate, simplifying the operation process, and adapting to different combat needs.
Smart Images

Figure CN116832443B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of virtual environments, and in particular to a method, apparatus, device, medium, and program product for using virtual firearms. Background Technology
[0002] In the gaming world, players control virtual objects that engage in combat using virtual firearms.
[0003] In related technologies, players often need to switch virtual weapons to cope with different scenarios. For example, at any given moment, the virtual object controlled by the player encounters a close-range attack from an enemy. The virtual object is currently armed with a virtual rifle (low accuracy). Later, if the player-controlled virtual object wants to engage the enemy at a long distance, the player needs to switch the virtual rifle to a virtual sniper rifle (high accuracy). However, after switching virtual weapons, the player needs to obtain the configuration information of the switched virtual weapon through the equipment panel. For example, the previous virtual rifle had a rifle suppressor, while the switched virtual sniper rifle does not. During sniping, it's not suitable to determine whether a suppressor is equipped based on the sound of firing (it easily alerts the enemy).
[0004] Obviously, in the relevant technology, when players switch virtual weapons to deal with different scenarios, they still need to obtain the configuration information of the switched virtual weapons, making the player's operation very cumbersome. Summary of the Invention
[0005] This application provides a method, apparatus, device, medium, and program product for using a virtual firearm, and provides a virtual firearm that supports multiple firing modes with different hit rates. The technical solution is as follows:
[0006] According to one aspect of this application, a method for using a virtual firearm is provided, the method comprising:
[0007] When the virtual weapon is in the first firing mode, in response to receiving the first firing operation, a screen showing the first virtual object using the virtual weapon to fire in real time is displayed;
[0008] Switching the virtual weapon from the first firing mode to the second firing mode results in a lower hit rate for the first firing mode compared to the second firing mode.
[0009] When the virtual weapon is in the second firing mode, in response to receiving the second firing operation, a screen is displayed showing the first virtual object using the virtual weapon to fire after a delay of the target duration.
[0010] According to another aspect of this application, a device for using a virtual firearm is provided, the device comprising:
[0011] The display module is used to display the screen of the first virtual object firing the virtual firearm in real time when the virtual firearm is in the first firing mode and in response to receiving the first firing operation.
[0012] The switching module is used to switch the virtual weapon from the first firing mode to the second firing mode. The hit rate of the first firing mode is lower than that of the second firing mode.
[0013] The display module is also used to display, in response to receiving a second firing operation, a screen showing the first virtual object firing with the virtual firearm after a delay of the target duration when the virtual firearm is in the second firing mode.
[0014] According to one aspect of this application, a computer device is provided, the computer device comprising: a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the method of using a virtual firearm as described above.
[0015] According to another aspect of this application, a computer-readable storage medium is provided, the storage medium storing a computer program that is loaded and executed by a processor to implement the method of using a virtual firearm as described above.
[0016] According to another aspect of this application, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, causing the computer device to perform the method of using the virtual firearm provided in the above aspect.
[0017] The beneficial effects of the technical solutions provided in this application include at least the following:
[0018] By designing the same virtual firearm to support multiple firing modes, in the first firing mode, the first virtual object uses the virtual firearm to fire instantly, and in the second firing mode, the first virtual object uses the virtual firearm to fire after a delay of the target time. The hit rate of the second firing mode is higher than that of the first firing mode, thus providing a virtual firearm that supports multiple firing modes with different hit rates.
[0019] Furthermore, when the first virtual object encounters a close-range attack from an enemy, it can use the first firing mode; when the first virtual object snipes an enemy at a long distance, it can use the second firing mode. In other words, the first virtual object can handle multiple combat scenarios with only one virtual weapon, avoiding the cumbersome operation of checking the configuration of the virtual weapon after switching virtual weapons. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 A block diagram of a computer system provided in an exemplary embodiment is shown;
[0022] Figure 2 A flowchart illustrating a method of using a virtual firearm provided in an exemplary embodiment is shown.
[0023] Figure 3 A schematic diagram of the collision box of a first virtual object provided in an exemplary embodiment is shown;
[0024] Figure 4 A schematic diagram of a virtual firearm in the related art provided by an exemplary embodiment is shown;
[0025] Figure 5 A schematic diagram of a virtual firearm in a first firing mode provided by an exemplary embodiment is shown;
[0026] Figure 6 A schematic diagram illustrating the virtual weapon state set by an animation machine according to an exemplary embodiment is shown;
[0027] Figure 7 A schematic diagram of a virtual firearm with a second firing mode provided in an exemplary embodiment is shown;
[0028] Figure 8 A schematic diagram of a virtual firearm with a second firing mode provided by another exemplary embodiment is shown;
[0029] Figure 9 A schematic diagram illustrating the hit rate of a first firing mode is shown in an exemplary embodiment.
[0030] Figure 10 A schematic diagram illustrating the hit rate of a second firing mode is shown in an exemplary embodiment.
[0031] Figure 11 A flowchart illustrating a method of using a virtual firearm provided by another exemplary embodiment is shown;
[0032] Figure 12 A schematic diagram of a first offset angle range provided by an exemplary embodiment is shown;
[0033] Figure 13A schematic diagram of a second offset angle range provided by an exemplary embodiment is shown;
[0034] Figure 14 A flowchart illustrating a method of using a virtual firearm provided by another exemplary embodiment is shown;
[0035] Figure 15 A flowchart illustrating a method of using a virtual firearm provided by another exemplary embodiment is shown;
[0036] Figure 16 A flowchart illustrating a method of using a virtual firearm provided by another exemplary embodiment is shown;
[0037] Figure 17 A schematic diagram illustrating the interaction process of a computer system provided in an exemplary embodiment is shown;
[0038] Figure 18 A structural block diagram of a device for using a virtual firearm provided in an exemplary embodiment is shown.
[0039] Figure 19 A structural block diagram of a computer device provided in an exemplary embodiment is shown. Detailed Implementation
[0040] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0041] It should be understood that "several" in this article refers to one or more, and "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0042] First, a brief introduction to the terms used in the embodiments of this application:
[0043] Virtual environment: This refers to the virtual environment displayed (or provided) by the client when running on the terminal. This virtual environment can be a simulation of the real world, a semi-simulated / semi-fictional environment, or a purely fictional environment. The virtual environment can be any of a two-dimensional, 2.5-dimensional, or three-dimensional virtual environment; this application does not limit it to any particular type. The following embodiments use a three-dimensional virtual environment as an example.
[0044] Optionally, the virtual environment can provide a battle environment for virtual objects. For example, in a battle royale game, at least one virtual object engages in a single battle in the virtual environment. The virtual object survives by avoiding attacks from enemy units and dangers present in the virtual environment (such as poison gas circles, swamps, etc.). When a virtual object's health points in the virtual environment reach zero, its life in the virtual environment ends, and the last surviving virtual object is the winner.
[0045] Figure 1 A structural block diagram of a computer system provided in an exemplary embodiment of this application is shown. The computer system 100 includes a terminal 120 and a server 140.
[0046] Terminal 120 has a client installed and running that supports a virtual environment. The client is logged into with a control account for the first virtual object. The client can be any of the following: a 3D map application, a side-scrolling shooter, a side-scrolling adventure game, a side-scrolling platformer, a side-scrolling strategy game, a virtual reality (VR) application, or an augmented reality (AR) application. Terminal 120 is the user's terminal, used to control the first virtual object located in the virtual environment. These activities include, but are not limited to: adjusting body posture, walking, running, jumping, riding, driving, aiming, picking up, and using at least one of the following: throwing objects. For example, the first virtual object is a virtual character, such as a realistic or anime character. For example, the user controls the first virtual object's activities through UI controls on the virtual environment screen.
[0047] Terminal 120 is connected to server 140 via a wireless network or a wired network.
[0048] Server 140 includes at least one of a single server, multiple servers, a cloud computing platform, and a virtualization center. For example, server 140 includes a processor 144 and a memory 142. Memory 142 further includes a receiving module 1421, a control module 1422, and a sending module 1423. The receiving module 1421 receives requests sent by clients, such as requests to control the movement of virtual objects. The control module 1422 controls the rendering of the virtual environment. The sending module 1423 sends responses to clients, such as indicating that the position of a virtual object has changed. Server 140 provides background services to clients supporting the virtual environment. Optionally, server 140 undertakes the primary computing work, and terminal 120 undertakes secondary computing work; or, server 140 undertakes secondary computing work, and terminal 120 undertakes primary computing work; or, server 140 and terminal 120 undertake computing work collaboratively.
[0049] Optionally, the client described above can run on different operating system platforms (Android or iOS). Optionally, the device type of the terminal includes at least one of the following: smartphone, smartwatch, in-vehicle terminal, wearable device, smart TV, tablet computer, e-book reader, MP3 player, MP4 player, laptop computer, and desktop computer. The following embodiments use a smartphone as an example.
[0050] Those skilled in the art will understand that the number of terminals described above can be more or less. For example, there may be only one terminal, or there may be dozens or hundreds of terminals, or even more. This application does not limit the number of terminals or the type of device.
[0051] To provide a virtual weapon that supports multiple firing modes with different hit rates, Figure 2 A flowchart illustrating a method for using a virtual firearm provided in an exemplary embodiment of this application is shown, in which the method is applied... Figure 1 The method, illustrated by the terminal 120 (or a client supporting a virtual environment installed on the terminal 120), includes:
[0052] Step 220: When the virtual weapon is in the first firing mode, in response to receiving the first firing operation, display a screen showing the first virtual object using the virtual weapon to fire in real time;
[0053] Virtual firearms: These refer to virtual weapons, such as firearms, held by the first virtual object in a virtual environment. Examples include virtual pistols, virtual rifles, virtual sniper rifles, and virtual shotguns. In one embodiment, the virtual firearm has a built-in virtual hammer. In this case, the process of firing virtual ammunition through the virtual firearm can be briefly summarized as follows: filling the virtual magazine with virtual ammunition (optional) - loading the virtual ammunition - pulling the trigger - the built-in virtual hammer strikes the firing pin - the firing pin fires the virtual ammunition - the virtual ammunition is fired.
[0054] The first virtual object refers to an active object controlled by the client within a virtual environment. This active object can be a virtual character, virtual animal, anime character, etc., such as a person or animal displayed in a 3D virtual environment. Optionally, the virtual object is a 3D model created based on animation skeletal technology. Each virtual object has its own shape and volume in the 3D virtual environment, occupying a portion of the space within the 3D virtual environment. (Refer to reference) Figure 3 This shows that multiple collision boxes exist on the first virtual object. For example... Figure 3As shown, the head and torso collision boxes of the first virtual object are cubes, while the collision boxes for the arms and thighs are obtained by piecing together hemispheres and cuboids. The collision boxes are used to detect whether virtual projectiles (or collision rays) hit the first virtual object. In other words, the collision boxes are used to set the rigid body properties of the first virtual object's 3D model; these properties indicate that the 3D model occupies a portion of space in the virtual environment.
[0055] First Firing Mode: This refers to the firing mode that supports the first virtual object to fire instantly using a virtual weapon. Optionally, "first virtual object fires instantly using a virtual weapon" means that the first virtual object only performs the action of pulling the trigger.
[0056] The first firing operation refers to the firing operation that controls the first virtual object to use a virtual weapon to fire in real time. Optionally, the first firing operation is used for the virtual weapon to fire a single virtual bullet or multiple virtual bullets. In one embodiment, a firing control exists on the virtual environment interface. When the virtual weapon is in the first firing mode, in response to the firing control receiving a first trigger operation, the terminal controls the first virtual object to use the virtual weapon to fire in real time. Optionally, the first trigger operation includes a single click operation and a continuous touch operation of the firing control, etc.
[0057] In another embodiment, the player controls the first virtual object to perform real-time shooting using peripherals such as a gamepad, mouse, or keyboard. In yet another embodiment, the player can control the first virtual object to perform real-time shooting using VR (Virtual Reality) glasses, VR headsets, voice control, or motion sensing.
[0058] Reference Figure 4 The illustration shows a scene in the related technology where a player-controlled virtual object uses a virtual weapon to fire. The virtual weapon 401 only has an instant firing mode. In response to the virtual environment interface receiving a click operation of the firing control 402, the virtual object immediately uses the virtual weapon 401 to fire virtual ammunition.
[0059] Reference Figure 5 It shows a scene of a first virtual object firing a virtual gun 501 in the first firing mode provided in this application. In response to the firing control 502 receiving the first firing operation, the first virtual object immediately fires virtual ammunition using the virtual gun 501.
[0060] In one embodiment, the virtual firearm's preset firing types include single-shot, burst-fire, and fully automatic. When the virtual firearm's firing type is single-shot, in response to a single click on the firing control, the virtual firearm will fire a single burst of virtual ammunition. Single-shot is suitable for firing at enemies at a relatively long distance using a virtual scope. When the virtual firearm's firing type is burst-fire, in response to a single click on the firing control, the virtual firearm will fire a preset number of virtual ammunition. For example, if the firing type is three-round burst, a single click on the firing control will fire three virtual rounds. Burst-fire is suitable for firing at enemies at medium to long distances. When the virtual firearm's firing type is fully automatic, in response to a continuous touch on the firing control, the virtual firearm will fire an unlimited number of virtual rounds (within the limits of the magazine's capacity).
[0061] In this application, the first firing operation is compatible with the firing types of the aforementioned common virtual firearms. The first firing operation does not actually distinguish between single shot, burst fire, and fully automatic fire. The first firing operation refers to the operation of controlling the virtual firearm to fire a single virtual ammunition or multiple virtual ammunitions. That is, the first firing operation is distinguished by the number of virtual ammunitions fired.
[0062] Reference Figure 6 It illustrates a diagram showing how to set the firing mode of a virtual weapon using an animation machine. When the virtual weapon is in the first firing mode, the animation machine executes... Figure 6 The path shown by the dashed line will not be executed on the path shown by the bold solid line.
[0063] Step 240: Switch the virtual weapon from the first firing mode to the second firing mode. The hit rate of the first firing mode is lower than that of the second firing mode.
[0064] In one embodiment, a virtual hammer is externally mounted at the rear of the virtual firearm. The process of firing virtual ammunition through the virtual firearm can be briefly summarized as follows: filling the virtual magazine with virtual ammunition (optional) - loading the virtual ammunition - moving the virtual hammer (to bring the virtual hammer to a fully charged state) - pulling the trigger - the external virtual hammer strikes the firing pin - the firing pin fires the virtual ammunition - the virtual ammunition is launched.
[0065] Second firing mode: This refers to a firing mode that allows the first virtual object to fire using a virtual weapon after a target delay. Optionally, the first virtual object firing after the target delay refers to the first virtual object performing two actions: pulling the trigger and cocking the virtual hammer.
[0066] It should be noted that in all embodiments of this application, turning the virtual hammer is not regarded as the action of the first virtual object using a virtual firearm to shoot.
[0067] In one embodiment, Figure 5 A mode switching control 503 is also shown, which, in response to receiving at least one of a click operation, a touch operation, a touch-release operation, or a drag operation, switches the first firing mode of the virtual gun 501 to a second firing mode. Figure 5 The virtual hammer 504, externally mounted at the rear of the virtual firearm, is also shown. Figure 5 As can be seen, the virtual hammer 504 is in a protruding state at this time.
[0068] In one embodiment, when the terminal automatically detects a change in the combat scenario faced by the first virtual object, the terminal switches the virtual weapon from the first firing mode to the second firing mode. For example, when the terminal automatically detects a change in the combat scenario of the first virtual object from close-range assault to long-range sniping, the terminal automatically switches the virtual weapon from the first firing mode to the second firing mode.
[0069] In one embodiment, when the terminal automatically detects that the remaining number of virtual ammunition for the first virtual object is lower than a preset threshold, the terminal switches the virtual firearm from the first firing mode to the second firing mode.
[0070] Hit rate: refers to the probability that virtual ammunition fired by the virtual firearm will hit the target when the target is within the firing range of the virtual firearm and the first virtual object is aiming the virtual firearm in the correct direction towards the target. In other words, it is the probability that the trajectory of the virtual ammunition will hit the target. In this application, the hit rate is an inherent attribute of the virtual firearm. Optionally, aiming the first virtual object towards the target using the virtual firearm means that the crosshair of the virtual firearm is directly aligned with the target on the virtual environment interface. The crosshair of the virtual firearm can be a crosshair, a circle, a polygonal line, etc.
[0071] Step 260: When the virtual weapon is in the second firing mode, in response to receiving the second firing operation, display a screen showing the first virtual object using the virtual weapon to fire after a delay of the target duration.
[0072] The second firing operation refers to the firing operation that controls the first virtual object to use a virtual weapon to fire after a target delay. Optionally, the second firing operation is used for the virtual weapon to fire a single or multiple virtual rounds. In one embodiment, a firing control exists on the virtual environment interface. When the virtual weapon is in the second firing mode, in response to the firing control receiving a second trigger operation, the terminal controls the first virtual object to use the virtual weapon to fire after a target delay. Optionally, the second trigger operation includes a single click operation and a continuous touch operation of the firing control.
[0073] In conjunction with the firing types of the virtual firearms described above (single shot, burst fire, and full automatic fire), the second firing operation is also compatible with all firing types. This is because the second firing operation is distinguished by the number of virtual ammunition fired. The second firing operation refers to the firing operation of controlling the virtual firearm to fire a single virtual ammunition or multiple virtual ammunition.
[0074] In one embodiment, a virtual hammer is externally mounted on the rear of the virtual firearm. In response to receiving a second firing operation, the terminal plays an animation of the first virtual object turning the virtual hammer. After the animation finishes playing, a screen is displayed showing the first virtual object firing the virtual firearm.
[0075] Reference Figure 7 The image shows a single frame of animation showing the first virtual object moving the virtual hammer while in scoped-in mode. The virtual weapon 501 has a virtual hammer mounted on its rear. At this moment, the first virtual object is moving the virtual hammer, pressing the protruding virtual hammer into the interior of the virtual weapon.
[0076] Reference Figure 8 It shows a frame of animation of the first virtual object turning the virtual hammer in hip-fire mode (without aiming down sights). At this time, the first virtual object is turning the virtual hammer.
[0077] After the animation of the first virtual object turning the virtual hammer finishes playing, the first virtual object uses a virtual gun to fire in real time.
[0078] Reference Figure 6 It illustrates a diagram showing how to set the firing mode of a virtual weapon using an animation machine. When the virtual weapon is in the second firing mode, the animation machine executes... Figure 6 The path indicated by the bold solid line will not be executed; the path indicated by the dashed line will not be executed.
[0079] In summary, by designing the same virtual firearm to support multiple firing modes, in the first firing mode, the first virtual object uses the virtual firearm to fire instantly, and in the second firing mode, the first virtual object uses the virtual firearm to fire after a delay of the target time. The hit rate of the second firing mode is higher than that of the first firing mode, thus providing a virtual firearm that supports multiple firing modes with different hit rates.
[0080] The virtual firearms provided in this application support the use of different firing modes in different combat scenarios, with the firing mode matching the combat scenario. For example, when the first virtual object faces a close-range assault from an enemy, the first virtual object can use the first firing mode; when the first virtual object snipes an enemy at a long distance, it can use the second firing mode.
[0081] Furthermore, a virtual hammer is externally mounted at the rear of the virtual weapon, which is a reasonable design for the virtual weapon. Before turning the virtual hammer, it is in the first firing mode, and after turning the virtual hammer, it is in the second firing mode.
[0082] Furthermore, by playing an animation of the first virtual object bending the virtual hammer, a firing mode that trades time for hit rate was achieved.
[0083] To visually demonstrate that the hit rate of the first firing mode is lower than that of the second firing mode, we will illustrate this by showing the distribution of bullet holes left on the virtual wall by the virtual weapons in the first and second firing modes. Please refer to [link / reference]. Figure 9 It shows multiple bullet holes left on the wall by multiple virtual bullets fired continuously by the virtual gun in the first firing mode without adjusting the aiming direction of the virtual gun. The bullet holes in circle 901 are closer to the aiming direction of the virtual gun, and circle 902 includes all the bullet holes, in which it can be seen that the distribution range of all the bullet holes is relatively dispersed.
[0084] Please refer to Figure 10 The image shows multiple bullet holes left on a wall by a series of virtual bullets fired in the second firing mode, without adjusting the aiming direction of the virtual weapon. The bullet holes within circle 1001 almost overlap and lie in the aiming direction of the virtual weapon, indicating a relatively concentrated distribution of the bullet holes. Combined with... Figure 9 and Figure 10 It can be seen that the hit rate of the first firing mode is significantly lower than that of the second firing mode.
[0085] The following section details how the hit rate of the first firing mode is adjusted to the hit rate of the second firing mode in this application.
[0086] based on Figure 2 In the optional embodiment shown, step 220 can be replaced by step 221, and step 260 can be replaced by step 261. Figure 11 A flowchart illustrating a method for using a virtual firearm according to an exemplary embodiment of this application is shown. The method includes:
[0087] Step 221: When the virtual firearm is in the first firing mode, in response to receiving the first firing operation, control the first virtual object to use the virtual firearm to fire the first virtual ammunition at the first target, and control the first virtual ammunition to fly along the first ballistic trajectory.
[0088] First target: In this application, the first target refers to the target aimed at by the first virtual object when using a virtual firearm in the first firing mode. The types of first targets include, but are not limited to, virtual objects and virtual entities. The first target can be a virtual object belonging to a different faction than the first virtual object, or a non-player character in the virtual environment. The first target can also be environmental elements of the virtual environment, such as virtual trees, virtual walls, virtual rocks, etc.
[0089] In one embodiment, the ballistic trajectory of the virtual ammunition is related to the aiming direction and dispersion offset of the first virtual object. The dispersion offset can be understood as the offset angle superimposed on the muzzle direction when the virtual ammunition is fired from the muzzle, and its purpose is to simulate the situation in the real world where the ballistic trajectory will be deviated due to the influence of airflow, gravity, etc.
[0090] In one embodiment, controlling the first virtual munition to fly along a first ballistic trajectory includes: determining a first dispersion offset from a first offset angle range using a pseudo-random algorithm; generating a first ballistic trajectory based on a first aiming direction of the first virtual object toward a first target and the first dispersion offset; and controlling the first virtual munition to fly along the first ballistic trajectory. The direction of the first ballistic trajectory is obtained by summing the first aiming direction and the first dispersion offset by an angle.
[0091] First dispersion offset: refers to the offset angle superimposed on the muzzle direction when the first virtual bullet is fired from the muzzle of the virtual weapon.
[0092] For example, the terminal uses the timestamp as a pseudo-random number seed and calculates the first dispersion offset based on the maximum offset angle of the first virtual ammunition within the first offset angle range and the pseudo-random function. The maximum offset angle of the first virtual ammunition and the pseudo-random function are preset data.
[0093] For the first virtual munition, the terminal calculates the first dispersion offset using the following formula:
[0094] f(x) = v θ *Random(x);
[0095] Where f(x) is the first divergence offset, v θ It is the maximum offset angle in the first offset angle interval, and Random(x) is a pseudo-random function.
[0096] For example, in conjunction with reference Figure 12 , Figure 12 The first aiming direction 1202 and the maximum offset angle 1201 (v) of the first offset angle range are shown. θ ).
[0097] It is worth noting that using the timestamp as a pseudo-random number seed as described above aims to ensure that the initial distribution offset calculated by all terminals and servers is the same. With a consistent pseudo-random number seed, the offset angles calculated using the same pseudo-random function from the same offset angle range will all be identical.
[0098] Step 240: Switch the virtual weapon from the first firing mode to the second firing mode. The hit rate of the first firing mode is lower than that of the second firing mode.
[0099] In one embodiment, a virtual hammer is externally mounted at the rear of the virtual firearm. The process of firing virtual ammunition through the virtual firearm can be briefly summarized as follows: filling the virtual magazine with virtual ammunition (optional) - loading the virtual ammunition - moving the virtual hammer (to bring the virtual hammer to a fully charged state) - pulling the trigger - the external virtual hammer strikes the firing pin - the firing pin fires the virtual ammunition - the virtual ammunition is launched.
[0100] Second firing mode: This refers to a firing mode that allows the first virtual object to fire a virtual weapon after a time delay. Optionally, the first virtual object performs two actions: pulling the trigger and cocking the virtual hammer.
[0101] Step 261: When the virtual firearm is in the second firing mode, in response to receiving the second firing operation, play the animation of the first virtual object turning the virtual hammer; after the animation finishes playing, control the first virtual object to use the virtual firearm to fire the second virtual ammunition at the second target, and control the second virtual ammunition to fly along the second ballistic trajectory; wherein, the probability of the first ballistic trajectory hitting the first target is less than the probability of the second ballistic trajectory hitting the second target.
[0102] Second target: In this application, the second target refers to the target that the first virtual object aims at when using a virtual firearm in a second firing mode. The types of second targets include, but are not limited to, virtual objects and virtual entities. The second target can be a virtual object belonging to a different faction than the first virtual object, or a non-player character in the virtual environment. The second target can also be environmental elements of the virtual environment, such as virtual trees, virtual walls, virtual rocks, etc.
[0103] In one embodiment, controlling the second virtual munition to fly along a second ballistic trajectory includes: determining a second dispersion offset from a second offset angle interval using a pseudo-random algorithm; generating a second ballistic trajectory based on a second aiming direction from the first virtual object toward the second target and the second dispersion offset; and controlling the second virtual munition to fly along the second ballistic trajectory; wherein the maximum value of the first offset angle interval is greater than the maximum value of the second offset angle interval. The direction of the second ballistic trajectory is obtained by summing the second aiming direction and the second dispersion offset by angles.
[0104] Second dispersion offset: refers to the offset angle superimposed on the muzzle direction when the second virtual ammunition is fired from the muzzle of the virtual weapon.
[0105] For example, the terminal uses the timestamp as a pseudo-random number seed, and calculates the second dispersion offset of the second virtual ammunition based on the maximum offset angle of the second virtual ammunition within the second offset angle range and the pseudo-random function. The maximum offset angle of the second virtual ammunition and the pseudo-random function are preset data.
[0106] For the second virtual munition, the terminal calculates the second dispersion offset using the following formula:
[0107] f(x′=v θ′ *Random(x′);
[0108] Where f(x′) is the second divergence offset, v θ′ It is the maximum offset angle in the second offset angle interval, and Random(x′) is a pseudo-random function.
[0109] For example, in conjunction with reference Figure 13 , Figure 13 The second aiming direction 1302 and the maximum offset angle 1301 (v) of the second offset angle range are shown. θ′ (Refer to reference) Figure 12 and Figure 13 It can be seen that the maximum offset angle 1201 in the first offset angle interval is greater than the maximum offset angle 1301 in the second offset angle interval.
[0110] In summary, the ballistic trajectory of the virtual ammunition is related to the aiming direction of the first virtual object and the dispersion deviation of the virtual ammunition. By changing the dispersion deviation of the virtual ammunition, it is technically possible to achieve a higher hit rate for the second firing mode than for the first firing mode.
[0111] Optionally, there is another possible implementation of steps 221 and 261 above.
[0112] Step 221: In response to receiving the first firing operation, control the first virtual object to fire the first virtual ammunition at the first target using a virtual firearm, and control the first virtual ammunition to fly along the first ballistic trajectory;
[0113] In one embodiment, the ballistic trajectory of the virtual ammunition is related to the aiming direction and recoil offset of the first virtual object. Recoil offset can be understood as the angular deviation between the muzzle direction when the first virtual object pulls the trigger and the muzzle direction when the virtual ammunition is fired, under the influence of recoil force.
[0114] Optionally, controlling the first virtual munition to fly along the first ballistic trajectory includes: determining a first recoil offset matching the first firing mode; generating the first ballistic trajectory based on the first aiming direction of the first virtual object toward the first target and the first recoil offset; and controlling the first virtual munition to fly along the first ballistic trajectory.
[0115] The direction of the first ballistic trajectory is obtained by summing the angles of the first aiming direction and the first recoil offset.
[0116] First recoil offset: refers to the angular offset between the muzzle direction when the first virtual object pulls the trigger and the muzzle direction when the first virtual ammunition is fired. Optionally, the first recoil offset is a preset offset angle corresponding to the first firing mode.
[0117] Step 261: In response to receiving the second firing operation, play the animation of the first virtual object turning the virtual hammer; after the animation finishes playing, control the first virtual object to use the virtual gun to fire the second virtual ammunition at the second target, and control the second virtual ammunition to fly along the second ballistic trajectory; wherein, the probability of the first ballistic trajectory hitting the first target is less than the probability of the second ballistic trajectory hitting the second target.
[0118] Optionally, controlling the second virtual munition to fly along the second ballistic trajectory includes: determining a second recoil offset that matches the second firing mode; generating a second ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the second recoil offset; and controlling the second virtual munition to fly along the second ballistic trajectory; wherein the first recoil offset is greater than the second recoil offset.
[0119] The direction of the second ballistic trajectory is obtained by summing the angles of the second aiming direction and the second recoil offset.
[0120] Second recoil offset: refers to the angular offset between the muzzle direction when the first virtual object pulls the trigger and the muzzle direction when the second virtual ammunition is fired. Optionally, the second recoil offset is a preset recoil offset angle corresponding to the second firing mode.
[0121] In summary, the ballistic trajectory of the virtual ammunition is related to the aiming direction of the first virtual object and the recoil offset of the virtual ammunition. By changing the recoil offset of the virtual ammunition, it is technically possible to achieve a higher hit rate for the second firing mode than for the first firing mode.
[0122] It should be noted that the ballistic trajectory of the aforementioned virtual ammunition may also be related to the aiming direction, dispersion offset, and recoil offset of the first virtual object. The specific implementation can be achieved by simply combining the two methods described above, and will not be elaborated upon here.
[0123] based on Figure 2In the alternative embodiments shown, step 260 may be replaced by steps 262-1, 262-2 and 262-3. Figure 14 A flowchart illustrating a method for using a virtual firearm according to an exemplary embodiment of this application is shown. The method includes:
[0124] Step 262-1: When the virtual firearm is in the second firing mode, in response to receiving the instruction to perform n firing operations, before performing n firing operations, play at least one animation of the first virtual object turning the virtual hammer.
[0125] In one embodiment, in conjunction with reference Figure 7 or Figure 8 In response to a continuous touch operation received by the firing control 502, the terminal plays an animation at least once showing the first virtual object turning the virtual hammer. The continuous touch operation controls the first virtual object to perform n firing operations using the virtual weapon 501, i.e., to fire n virtual bullets through the virtual weapon 501. After the animation finishes playing, the terminal will control the first virtual object to perform n firing operations using the virtual weapon.
[0126] Step 262-2: After the animation finishes playing, during the i-th shooting process, control the first virtual object to use the virtual gun to fire the i-th virtual ammunition at the second target, and control the i-th virtual ammunition to fly along the i-th ballistic trajectory.
[0127] In this embodiment, only one virtual ammunition is fired in a single firing process. The i-th virtual ammunition corresponds to the i-th firing, and the (i+1)-th virtual ammunition corresponds to the (i+1)-th firing. n is a positive integer greater than 1, and i is a positive integer not greater than n.
[0128] In one embodiment, controlling the i-th virtual ammunition to fly along the i-th ballistic trajectory includes: determining the i-th dispersion offset from the i-th offset angle interval using a pseudo-random algorithm; generating the i-th ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the i-th dispersion offset; and controlling the i-th virtual ammunition to fly along the i-th ballistic trajectory.
[0129] The direction of the i-th ballistic trajectory is obtained by summing the second aiming direction and the i-th dispersion offset by angle.
[0130] The i-th dispersion offset refers to the offset angle superimposed on the muzzle direction when the i-th virtual ammunition is fired from the muzzle. The detailed process of calculating the i-th dispersion offset using a pseudo-random algorithm has already been described above and will not be repeated here.
[0131] In another embodiment, controlling the i-th virtual ammunition to fly along the i-th ballistic trajectory includes: determining the i-th recoil offset matching the i-th shot; generating the i-th ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the i-th recoil offset; and controlling the i-th virtual ammunition to fly along the i-th ballistic trajectory.
[0132] The direction of the i-th ballistic trajectory is obtained by summing the second aiming direction and the i-th recoil offset by angle.
[0133] The i-th recoil offset refers to the angular offset between the muzzle direction when the first virtual object pulls the trigger and the muzzle direction when the i-th virtual ammunition is fired. Optionally, the i-th recoil offset is a pre-set recoil offset angle corresponding to the i-th shot.
[0134] Step 262-3: During the (i+1)th firing, control the first virtual object to fire the (i+1)th virtual ammunition at the second target using a virtual firearm, and control the (i+1)th virtual ammunition to fly along the (i+1)th ballistic trajectory; wherein, the probability of the (i)th ballistic trajectory hitting the second target is greater than the probability of the (i+1)th ballistic trajectory hitting the second target.
[0135] In one embodiment, controlling the (i+1)th virtual ammunition to fly along the (i+1)th ballistic trajectory includes: determining the (i+1)th dispersion offset from the (i+1)th offset angle interval using a pseudo-random algorithm; generating the (i+1)th ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the (i+1)th dispersion offset; and controlling the (i+1)th virtual ammunition to fly along the (i+1)th ballistic trajectory; wherein the maximum value of the (i+1)th offset angle interval is greater than the maximum value of the (i)th offset angle interval.
[0136] The direction of the (i+1)th ballistic trajectory is obtained by summing the second aiming direction and the (i+1)th dispersion offset by angle.
[0137] The (i+1)th dispersion offset refers to the offset angle superimposed on the muzzle direction when the (i+1)th virtual ammunition is fired from the muzzle of the virtual weapon. The detailed process of calculating the (i+1)th dispersion offset using a pseudo-random algorithm has already been described above and will not be repeated here.
[0138] In another embodiment, controlling the (i+1)th virtual ammunition to fly along the (i+1)th ballistic trajectory includes: determining the (i+1)th recoil offset matching the (i+1)th shot; generating the (i+1)th ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the (i+1)th recoil offset; and controlling the (i+1)th virtual ammunition to fly along the (i+1)th ballistic trajectory; wherein the (i+1)th recoil offset is greater than the (i)th recoil offset.
[0139] The direction of the (i+1)th ballistic trajectory is obtained by summing the second aiming direction and the (i+1)th recoil offset by angle.
[0140] The (i+1)th recoil offset refers to the angular offset between the muzzle direction when the first virtual object pulls the trigger and the muzzle direction when the (i+1)th virtual ammunition is fired. Optionally, the (i+1)th recoil offset is a pre-set recoil offset angle corresponding to the (i+1)th shot.
[0141] It should be noted that the ballistic trajectory of the aforementioned virtual ammunition may also be related to the aiming direction, dispersion offset, and recoil offset of the first virtual object. The specific implementation can be achieved by simply combining the two methods described above, and will not be elaborated upon here.
[0142] In summary, the design proposes a method for using a virtual weapon in the second firing mode to fire multiple times. After playing at least one animation, the weapon fires n times. As the number of fires increases, the hit rate of the virtual weapon gradually decreases. This provides a way to use the virtual weapon in multiple firings and ensures the rationality of the virtual weapon.
[0143] based on Figure 2 In the alternative embodiments shown, step 260 may be replaced by steps 263-1 and 263-2. Figure 15 A flowchart illustrating a method for using a virtual firearm according to an exemplary embodiment of this application is shown. The method includes:
[0144] Step 263-1: When the virtual firearm is in the second firing mode, in response to receiving the instruction to perform m firing operations, before the j-th firing, the animation of the first virtual object turning the virtual hammer is played for the j-th time; after the animation finishes playing, during the j-th firing, the first virtual object is controlled to use the virtual firearm to fire the j-th virtual ammunition at the second target, and the j-th virtual ammunition is controlled to fly along the j-th ballistic trajectory.
[0145] In one embodiment, in conjunction with reference Figure 7 or Figure 8 In response to a continuous touch operation received by the firing control 502, the terminal plays an animation of the first virtual object turning the virtual hammer m times. The continuous touch operation controls the first virtual object to perform m firing operations using the virtual weapon 501, i.e., to fire m virtual bullets through the virtual weapon 501. After each animation finishes playing, the terminal controls the first virtual object to fire once using the virtual weapon.
[0146] In this embodiment, only one virtual ammunition is fired in each firing process. The j-th virtual ammunition corresponds to the j-th firing, and the (j+1)-th virtual ammunition corresponds to the (j+1)-th firing. Furthermore, the j-th virtual ammunition corresponds to the j-th animation playback, and the (j+1)-th virtual ammunition corresponds to the (j+1)-th animation playback. m is a positive integer greater than 1, and j is a positive integer not greater than m.
[0147] In one embodiment, controlling the j-th virtual munition to fly along the j-th ballistic trajectory includes: determining the j-th dispersion offset from the j-th offset angle interval using a pseudo-random algorithm; generating the j-th ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the j-th dispersion offset; and controlling the j-th virtual munition to fly along the j-th ballistic trajectory.
[0148] The direction of the j-th ballistic trajectory is obtained by summing the second aiming direction and the j-th dispersion offset by angle.
[0149] The j-th dispersion offset: When the j-th virtual ammunition is fired from the muzzle of the virtual weapon, the offset angle superimposed on the muzzle direction. The detailed process of calculating the j-th dispersion offset using a pseudo-random algorithm has already been described above and will not be repeated here.
[0150] In another embodiment, controlling the j-th virtual ammunition to fly along the j-th ballistic trajectory includes: determining the j-th recoil offset matching the j-th shot; generating the j-th ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the j-th recoil offset; and controlling the j-th virtual ammunition to fly along the j-th ballistic trajectory.
[0151] The direction of the j-th ballistic trajectory is obtained by summing the second aiming direction and the j-th recoil offset by angle.
[0152] The j-th recoil offset refers to the angular offset between the muzzle direction when the first virtual object pulls the trigger and the muzzle direction when the j-th virtual bullet is fired. Optionally, the j-th recoil offset is a pre-set recoil offset angle corresponding to the j-th shot.
[0153] Step 263-2: Before the (j+1)th shot, the animation of the first virtual object turning the virtual hammer is played for the (j+1)th time; after the animation finishes playing, during the (j+1)th shot, the first virtual object is controlled to use a virtual firearm to fire the (j+1)th virtual ammunition at the second target, and the (j+1)th virtual ammunition is controlled to fly along the (j+1)th ballistic trajectory; wherein, the probability of the (j)th ballistic trajectory hitting the second target is equal to the probability of the (j+1)th ballistic trajectory hitting the second target.
[0154] In one embodiment, controlling the (j+1)th virtual ammunition to fly along the (j+1)th ballistic trajectory includes: determining the (j+1)th dispersion offset from the (j+1)th offset angle interval using a pseudo-random algorithm; generating the (j+1)th ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the (j+1)th dispersion offset; and controlling the (j+1)th virtual ammunition to fly along the (j+1)th ballistic trajectory; wherein the maximum value of the (j+1)th offset angle interval is equal to the maximum value of the (j)th offset angle interval.
[0155] The direction of the (j+1)th ballistic trajectory is obtained by summing the second aiming direction and the (j+1)th dispersion offset by angle.
[0156] The (j+1)th dispersion offset refers to the offset angle superimposed on the muzzle direction when the (j+1)th virtual ammunition is fired from the muzzle of the virtual weapon. The detailed process of calculating the (j+1)th dispersion offset using a pseudo-random algorithm has already been described above and will not be repeated here.
[0157] In another embodiment, controlling the (j+1)th virtual ammunition to fly along the (j+1)th ballistic trajectory includes: determining the (j+1)th recoil offset matching the (j+1)th shot; generating the (j+1)th ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the (j+1)th recoil offset; and controlling the (j+1)th virtual ammunition to fly along the (j+1)th ballistic trajectory; wherein the (j+1)th recoil offset is equal to the (j)th recoil offset; and the direction of the (j+1)th ballistic trajectory is obtained by summing the second aiming direction and the (j+1)th recoil offset by an angle.
[0158] The (j+1)th recoil offset refers to the angular offset between the muzzle direction when the first virtual object pulls the trigger and the muzzle direction when the (j+1)th virtual ammunition is fired. Optionally, the (j+1)th recoil offset is a pre-set recoil offset angle corresponding to the (j+1)th shot.
[0159] It should be noted that the ballistic trajectory of the aforementioned virtual ammunition may also be related to the aiming direction, dispersion offset, and recoil offset of the first virtual object. The specific implementation can be achieved by simply combining the two methods described above, and will not be elaborated upon here.
[0160] In summary, the design incorporates an animation played before each shot when using a virtual weapon in the second firing mode for multiple shots. Furthermore, the hit rate of the virtual weapon remains constant as the number of shots increases. This provides a method for using a virtual weapon in multiple shots, ensuring the rationality of the virtual weapon.
[0161] based on Figure 2 In the alternative embodiments shown, step 260 may be replaced by steps 264-1, 264-2, and 264-3. Figure 16 A flowchart illustrating a method for using a virtual firearm according to an exemplary embodiment of this application is shown. The method includes:
[0162] Step 264-1: In response to receiving the instruction to perform m firing operations, play the animation of the first virtual object bending the virtual hammer;
[0163] In one embodiment, in conjunction with reference Figure 7 or Figure 8In response to a continuous touch operation received by the firing control 502, the terminal plays an animation of the first virtual object turning the virtual hammer. The continuous touch operation controls the first virtual object to perform k firing operations using the virtual weapon 501, i.e., to fire k virtual rounds of ammunition through the virtual weapon 501.
[0164] Step 264-2: After the animation finishes playing, during the p-th firing, control the first virtual object to fire the p-th virtual ammunition at the second target using the virtual firearm in the second firing mode, and control the p-th virtual ammunition to fly along the p-th ballistic trajectory.
[0165] In this embodiment, only one virtual ammunition is fired in a single firing process. The p-th virtual ammunition corresponds to the p-th firing, and the (p+1)-th virtual ammunition corresponds to the (p+1)-th firing. k is a positive integer greater than 1, and p is a positive integer not greater than k.
[0166] Step 264-3: During the p+1th firing, control the first virtual object to fire the p+1th virtual ammunition at the second target using a virtual firearm in the second firing mode, and control the p+1th virtual ammunition to fly along the p+1th ballistic trajectory; wherein, if the pth firing hits the second target, the probability of the p+1th ballistic trajectory hitting the second target is higher than the probability of the pth ballistic trajectory hitting the second target.
[0167] Where p is a positive integer not greater than k.
[0168] To illustrate, if virtual ammunition p and virtual ammunition p+1 are fired in two consecutive firings, and virtual ammunition p successfully hits the second target, then the probability of virtual ammunition p+1 hitting the second target is set to be higher than the probability of virtual ammunition p+1 hitting the second target.
[0169] In summary, the design of a virtual gun with a second firing mode that fires multiple times increases the probability of hitting the second target in the next shot if the first shot successfully hits the second target in two consecutive shots. This provides a way to use a virtual gun in multiple shots, enhances the fun of the virtual gun, and increases the game's playability.
[0170] Figure 17 A flowchart illustrating a method for using a virtual firearm provided in an exemplary embodiment of this application is shown, wherein the method has Figure 1 The method, illustrated by example, is executed on terminal 120 (or a client supporting a virtual environment installed on terminal 120). The method includes:
[0171] Step 1701, Begin;
[0172] Players launch a client that supports virtual environments to begin using the virtual weapons described in this application.
[0173] Step 1702: The terminal starts the game's battle mode;
[0174] In response to a player starting a match, the terminal initiates the game's battle mode. In battle mode, the player controls a virtual object to perform actions such as jumping, running, crawling, and shooting within the virtual environment.
[0175] Step 1703: Does the virtual weapon support the triggering operation?
[0176] The terminal determines whether the virtual weapon held by the first virtual object supports a triggering operation. A triggering operation is the operation of controlling the first virtual object to trigger the external virtual hammer at the rear of the virtual weapon. If the virtual weapon supports triggering, step 1704 is executed; otherwise, step 1703 is re-executed.
[0177] Step 1704: The terminal displays the firing mode switching button;
[0178] The terminal displays a trigger button on the virtual environment interface to switch firing modes. This trigger button switches between immediate firing mode and delayed firing mode; the hit rate of immediate firing mode is lower than that of delayed firing mode.
[0179] Step 1705: Does the button for turning the machine receive a click operation?
[0180] The terminal determines whether the toggle button has been clicked. If yes, proceed to step 1706; otherwise, proceed to step 1704.
[0181] Step 1706: The virtual weapon enters delayed firing mode;
[0182] The terminal determines that the virtual weapon has entered delayed firing mode.
[0183] Step 1707: Does the firing control receive a touch operation?
[0184] The terminal determines whether the firing control has received a touch operation. If yes, it executes step 1708; otherwise, it re-executes step 1707.
[0185] Step 1708: The terminal plays the device breaking animation;
[0186] If the firing control receives a touch operation, the terminal plays a firing animation.
[0187] Step 1709: Has the machine-breaking animation finished playing?
[0188] The terminal determines whether the hand-breaking animation has finished playing. If yes, proceed to step 1710; otherwise, re-execute step 1709.
[0189] Step 1710: The virtual weapon enters firing mode;
[0190] The terminal determines that the virtual weapon has entered firing mode. Firing mode can be understood as the state in which the player-controlled virtual object pulls the trigger.
[0191] Step 1711: Has the firing control received a release operation?
[0192] The terminal determines whether the fire control has received a release operation. If yes, proceed to step 1712; otherwise, proceed to step 1710.
[0193] Step 1712, the virtual weapon stops firing;
[0194] The terminal controls the virtual firearm to stop firing.
[0195] Step 1713, End.
[0196] The terminal terminates the process of using the virtual firearm in this application.
[0197] Figure 18 This application shows a structural block diagram of a device for using a virtual firearm according to an exemplary embodiment of the present application. The device includes:
[0198] Display module 1801 is used to display a screen of the first virtual object firing in real time using the virtual firearm in response to receiving the first firing operation when the virtual firearm is in the first firing mode.
[0199] The switching module 1802 is used to switch the virtual firearm from the first firing mode to the second firing mode. The hit rate of the first firing mode is lower than that of the second firing mode.
[0200] The display module 1801 is also used to display a screen showing the first virtual object firing the virtual firearm after a delay of a target duration, in response to receiving a second firing operation when the virtual firearm is in the second firing mode.
[0201] In an optional embodiment, a virtual hammer is externally mounted on the rear of the virtual firearm. The display module 1801 is further configured to, in response to receiving a second firing operation, play an animation of the first virtual object turning the virtual hammer; after the animation finishes playing, display a scene of the first virtual object firing the virtual firearm.
[0202] In an optional embodiment, the display module 1801 is further configured to, in response to receiving a first firing operation, control the first virtual object to fire a first virtual ammunition at a first target using a virtual firearm, and control the first virtual ammunition to fly along a first ballistic trajectory;
[0203] In an optional embodiment, the display module 1801 is further configured to, in response to receiving a second firing operation, play an animation of the first virtual object turning a virtual hammer; after the animation finishes playing, control the first virtual object to fire a second virtual ammunition at the second target using a virtual firearm, and control the second virtual ammunition to fly along a second ballistic trajectory; wherein the probability of the first ballistic trajectory hitting the first target is less than the probability of the second ballistic trajectory hitting the second target.
[0204] In an optional embodiment, the display module 1801 is further configured to determine a first dispersion offset from a first offset angle range using a pseudo-random algorithm; generate a first ballistic trajectory based on a first aiming direction of the first virtual object toward the first target and the first dispersion offset; and control the first virtual munition to fly along the first ballistic trajectory.
[0205] In an optional embodiment, the display module 1801 is further configured to determine a second dispersion offset from the second offset angle interval using a pseudo-random algorithm; generate a second ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the second dispersion offset; and control the second virtual ammunition to fly along the second ballistic trajectory; wherein the maximum value of the first offset angle interval is greater than the maximum value of the second offset angle interval.
[0206] In an optional embodiment, the display module 1801 is further configured to determine a first recoil offset matching the first firing mode; generate a first ballistic trajectory based on the first aiming direction of the first virtual object toward the first target and the first recoil offset; and control the first virtual ammunition to fly along the first ballistic trajectory.
[0207] In an optional embodiment, the display module 1801 is further configured to determine a second recoil offset matching the second firing mode; generate a second ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the second recoil offset; and control the second virtual ammunition to fly along the second ballistic trajectory; wherein the first recoil offset is greater than the second recoil offset.
[0208] In an optional embodiment, the display module 1801 is further configured to, in response to receiving an instruction to perform n firing operations, play at least one animation of a first virtual object bending a virtual hammer before performing n firing operations.
[0209] In an optional embodiment, the display module 1801 is further configured to, after the animation has finished playing, during the i-th firing process, control the first virtual object to use a virtual firearm to fire the i-th virtual ammunition at the second target, and control the i-th virtual ammunition to fly along the i-th ballistic trajectory.
[0210] In an optional embodiment, the display module 1801 is further configured to control the first virtual object to fire the (i+1)th virtual ammunition at the second target using a virtual firearm during the (i+1)th firing, and to control the (i+1)th virtual ammunition to fly along the (i+1)th ballistic trajectory; wherein the probability of the (i)th ballistic trajectory hitting the second target is greater than the probability of the (i+1)th ballistic trajectory hitting the second target, n is a positive integer greater than 1, and i is a positive integer not greater than n.
[0211] In an optional embodiment, the display module 1801 is further configured to determine the i-th dispersion offset from the i-th offset angle interval using a pseudo-random algorithm; generate the i-th ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the i-th dispersion offset; and control the i-th virtual ammunition to fly along the i-th ballistic trajectory.
[0212] In an optional embodiment, the display module 1801 is further configured to determine the (i+1)th dispersion offset from the (i+1)th offset angle interval using a pseudo-random algorithm; generate the (i+1)th ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the (i+1)th dispersion offset; and control the (i+1)th virtual ammunition to fly along the (i+1)th ballistic trajectory; wherein the maximum value of the (i+1)th offset angle interval is greater than the maximum value of the (i)th offset angle interval.
[0213] In an optional embodiment, the display module 1801 is further configured to determine the i-th recoil offset matching the i-th shot; generate the i-th ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the i-th recoil offset; and control the i-th virtual ammunition to fly along the i-th ballistic trajectory.
[0214] In an optional embodiment, the display module 1801 is further configured to determine the (i+1)th recoil offset matching the (i+1)th shot; generate the (i+1)th ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the (i+1)th recoil offset; and control the (i+1)th virtual ammunition to fly along the (i+1)th ballistic trajectory; wherein the (i+1)th recoil offset is greater than the (i)th recoil offset.
[0215] In an optional embodiment, the display module 1801 is further configured to, in response to receiving an instruction to perform m firing operations, play an animation of the first virtual object turning the virtual hammer before the j-th firing; after the animation finishes playing, during the j-th firing, control the first virtual object to use a virtual weapon to fire the j-th virtual ammunition at the second target, and control the j-th virtual ammunition to fly along the j-th ballistic trajectory; before the (j+1)-th firing, play an animation of the first virtual object turning the virtual hammer; after the animation finishes playing, during the (j+1)-th firing, control the first virtual object to use a virtual weapon to fire the (j+1)-th virtual ammunition at the second target, and control the (j+1)-th virtual ammunition to fly along the (j+1)-th ballistic trajectory; wherein the probability of the j-th ballistic trajectory hitting the second target is equal to the probability of the (j+1)-th ballistic trajectory hitting the second target, m is a positive integer greater than 1, and j is a positive integer not greater than m.
[0216] In an optional embodiment, the display module 1801 is further configured to determine the j-th dispersion offset from the j-th offset angle interval using a pseudo-random algorithm; generate the j-th ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the j-th dispersion offset; and control the j-th virtual ammunition to fly along the j-th ballistic trajectory.
[0217] In an optional embodiment, the display module 1801 is further configured to determine the (j+1)th dispersion offset from the (j+1)th offset angle interval using a pseudo-random algorithm; generate the (j+1)th ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the (j+1)th dispersion offset; and control the (j+1)th virtual ammunition to fly along the (j+1)th ballistic trajectory; wherein the maximum value of the (j+1)th offset angle interval is equal to the maximum value of the jth offset angle interval.
[0218] In an optional embodiment, the display module 1801 is further configured to determine the j-th recoil offset matching the j-th shot; generate the j-th ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the j-th recoil offset; and control the j-th virtual ammunition to fly along the j-th ballistic trajectory.
[0219] In an optional embodiment, the display module 1801 is further configured to determine the (j+1)th recoil offset matching the (j+1)th shot; generate the (j+1)th ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the (j+1)th recoil offset; and control the (j+1)th virtual ammunition to fly along the (j+1)th ballistic trajectory; wherein the (j+1)th recoil offset is equal to the (j)th recoil offset.
[0220] In an optional embodiment, the display module 1801 is further configured to play an animation of the first virtual object bending the virtual hammer in response to receiving an instruction to perform m firing operations.
[0221] In an optional embodiment, the display module 1801 is further configured to, after the animation has finished playing, during the p-th firing process, control the first virtual object to fire the p-th virtual ammunition at the second target using a virtual firearm in the second firing mode, and control the p-th virtual ammunition to fly along the p-th ballistic trajectory.
[0222] In an optional embodiment, the display module 1801 is further configured to, during the (p+1)th firing, control the first virtual object to fire the (p+1)th virtual ammunition at the second target using a virtual firearm in the second firing mode, and control the (p+1)th virtual ammunition to fly along the (p+1)th ballistic trajectory; wherein, if the second target is hit by the pth firing, the probability of the (p+1)th ballistic trajectory hitting the second target is higher than the probability of the pth ballistic trajectory hitting the second target, k is a positive integer greater than 1, and p is a positive integer not greater than k.
[0223] In summary, by designing the same virtual firearm to support multiple firing modes, in the first firing mode, the first virtual object uses the virtual firearm to fire instantly, and in the second firing mode, the first virtual object uses the virtual firearm to fire after a delay of the target time. The hit rate of the second firing mode is higher than that of the first firing mode, thus providing a virtual firearm that supports multiple firing modes with different hit rates.
[0224] The virtual firearms provided in this application support the use of different firing modes in different combat scenarios, with the firing mode matching the combat scenario. For example, when the first virtual object faces a close-range assault from an enemy, the first virtual object can use the first firing mode; when the first virtual object snipes an enemy at a long distance, it can use the second firing mode.
[0225] Figure 19 A structural block diagram of a computer device 1900 provided in an exemplary embodiment of this application is shown. The computer device 1900 may be a portable mobile terminal, such as a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. The computer device 1900 may also be referred to as a user device, portable terminal, laptop terminal, desktop terminal, or other names.
[0226] Typically, computer device 1900 includes a processor 1901 and a memory 1902.
[0227] Processor 1901 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1901 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1901 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1901 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 1901 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0228] The memory 1902 may include one or more computer-readable storage media, which may be non-transitory. The memory 1902 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1902 is used to store at least one instruction, which is executed by the processor 1901 to implement the method of using a virtual firearm provided in the method embodiments of this application.
[0229] In some embodiments, the computer device 1900 may also optionally include a peripheral device interface 1903 and at least one peripheral device. The processor 1901, memory 1902, and peripheral device interface 1903 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1903 via a bus, signal line, or circuit board. For example, the peripheral device may include at least one of the following: a radio frequency circuit 1904, a display screen 1905, a camera assembly 1906, an audio circuit 1907, and a power supply 1908.
[0230] Peripheral interface 1903 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 1901 and memory 1902. In some embodiments, processor 1901, memory 1902 and peripheral interface 1903 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1901, memory 1902 and peripheral interface 1903 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0231] The radio frequency (RF) circuit 1904 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1904 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1904 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 1904 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 1904 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 19G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 1904 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0232] Display screen 1905 is used to display a UI (User Interface). This UI may include graphics, text, icons, video, and any combination thereof. When display screen 1905 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 1901 for processing. In this case, display screen 1905 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 1905, disposed on the front panel of computer device 1900; in other embodiments, there may be at least two display screens, disposed on different surfaces of computer device 1900 or in a folded design; in still other embodiments, display screen 1905 may be a flexible display screen, disposed on a curved or folded surface of computer device 1900. Furthermore, display screen 1905 may also be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The display screen 1905 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0233] The camera assembly 1906 is used to acquire images or videos. Optionally, the camera assembly 1906 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal, and the rear-facing camera is located on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 1906 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.
[0234] The audio circuit 1907 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting them into electrical signals that are input to the processor 1901 for processing, or to the radio frequency circuit 1904 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, positioned at different locations within the computer device 1900. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from the processor 1901 or the radio frequency circuit 1904 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 1907 may also include a headphone jack.
[0235] Power supply 1908 is used to supply power to the various components in computer device 1900. Power supply 1908 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 1908 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, and a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0236] In some embodiments, the computer device 1900 further includes one or more sensors 1909. The one or more sensors 1909 include, but are not limited to, an accelerometer 1910, a gyroscope 1911, a pressure sensor 1912, an optical sensor 1913, and a proximity sensor 1914.
[0237] Accelerometer 1910 can detect the magnitude of acceleration along the three coordinate axes of a coordinate system established by computer device 1900. For example, accelerometer 1910 can be used to detect the components of gravitational acceleration along the three coordinate axes. Processor 1901 can control display screen 1905 to display the user interface in either a landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 1910. Accelerometer 1910 can also be used for games or for acquiring user motion data.
[0238] The gyroscope sensor 1911 can detect the orientation and rotation angle of the computer device 1900. The gyroscope sensor 1911 can work in conjunction with the accelerometer sensor 1910 to acquire the user's 3D movements of the computer device 1900. Based on the data acquired by the gyroscope sensor 1911, the processor 1901 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.
[0239] The pressure sensor 1912 can be disposed on the side bezel of the computer device 1900 and / or on the lower layer of the display screen 1905. When the pressure sensor 1912 is disposed on the side bezel of the computer device 1900, it can detect the user's grip signal on the computer device 1900, and the processor 1901 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 1912. When the pressure sensor 1912 is disposed on the lower layer of the display screen 1905, the processor 1901 can control the operable controls on the UI interface based on the user's pressure operation on the display screen 1905. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
[0240] An optical sensor 1913 is used to collect ambient light intensity. In one embodiment, the processor 1901 can control the display brightness of the display screen 1905 based on the ambient light intensity collected by the optical sensor 1913. For example, when the ambient light intensity is high, the display brightness of the display screen 1905 is increased; when the ambient light intensity is low, the display brightness of the display screen 1905 is decreased. In another embodiment, the processor 1901 can also dynamically adjust the shooting parameters of the camera assembly 1906 based on the ambient light intensity collected by the optical sensor 1913.
[0241] The proximity sensor 1914, also known as a distance sensor, is typically located on the front panel of the computer device 1900. The proximity sensor 1914 is used to detect the distance between the user and the front of the computer device 1900. In one embodiment, when the proximity sensor 1914 detects that the distance between the user and the front of the computer device 1900 is gradually decreasing, the processor 1901 controls the display screen 1905 to switch from a screen-on state to a screen-off state; when the proximity sensor 1914 detects that the distance between the user and the front of the computer device 1900 is gradually increasing, the processor 1901 controls the display screen 1905 to switch from a screen-off state to a screen-on state.
[0242] Those skilled in the art will understand that Figure 19 The structure shown does not constitute a limitation on the computer device 1900, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0243] This application also provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the method of using the virtual firearm provided in the above method embodiments.
[0244] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method for using a virtual firearm provided in the above-described method embodiments.
[0245] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0246] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0247] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for using a virtual firearm, characterized in that, The method includes: When the virtual weapon is in the first firing mode, in response to receiving the first firing operation, a screen is displayed showing the first virtual object using the virtual weapon to fire in real time; The virtual firearm is switched from the first firing mode to the second firing mode, where the hit rate of the first firing mode is lower than that of the second firing mode. When the virtual firearm is in the second firing mode, in response to receiving a command to perform m firing operations, before the j-th firing, the animation of the first virtual object turning the virtual hammer is played for the j-th time; after the animation finishes playing, during the j-th firing, the j-th dispersion offset is determined from the j-th offset angle range using a pseudo-random algorithm; based on the second aiming direction of the first virtual object toward the second target and the j-th dispersion offset, the j-th ballistic trajectory is generated; and the j-th virtual ammunition is controlled to fly along the j-th ballistic trajectory. Before the (j+1)th shot, an animation of the first virtual object turning the virtual hammer is played for the (j+1)th time; after the animation finishes playing, during the (j+1)th shot, the first virtual object is controlled to fire the (j+1)th virtual ammunition at the second target using the virtual firearm, and the (j+1)th dispersion offset is determined from the (j+1)th offset angle interval using the pseudo-random algorithm; the (j+1)th ballistic trajectory is generated based on the second aiming direction of the first virtual object toward the second target and the (j+1)th dispersion offset; the (j+1)th virtual ammunition is controlled to fly along the (j+1)th ballistic trajectory; wherein, the maximum value of the (j+1)th offset angle interval is equal to the maximum value of the (j)th offset angle interval; Wherein, the probability that the j-th trajectory hits the second target is equal to the probability that the (j+1)-th trajectory hits the second target, m is a positive integer greater than 1, and j is a positive integer not greater than m.
2. The method according to claim 1, characterized in that, The virtual firearm has a virtual hammer externally mounted at its rear; the method further includes: In response to receiving a second firing command, play the animation of the first virtual object bending the virtual hammer; After the animation finishes playing, a scene is displayed showing the first virtual object shooting with the virtual weapon.
3. The method according to claim 2, characterized in that, The response to receiving the first firing operation, displaying a screen showing the first virtual object using the virtual weapon to fire in real time, includes: In response to receiving the first firing operation, the system controls the first virtual object to fire the first virtual ammunition at the first target using the virtual firearm, and controls the first virtual ammunition to fly along the first ballistic trajectory. In response to receiving a second firing command, the animation of the first virtual object turning the virtual hammer is played; after the animation finishes playing, a scene of the first virtual object firing the virtual weapon is displayed, including: In response to receiving the second firing operation, play the animation of the first virtual object bending the virtual hammer; After the animation finishes playing, control the first virtual object to use the virtual firearm to fire the second virtual ammunition at the second target, and control the second virtual ammunition to fly along the second ballistic trajectory; The probability that the first ballistic trajectory hits the first target is less than the probability that the second ballistic trajectory hits the second target.
4. The method according to claim 3, characterized in that, Controlling the first virtual munition to fly along the first ballistic trajectory includes: A pseudo-random algorithm is used to determine the first dispersion offset from the first offset angle range; the first ballistic trajectory is generated based on the first aiming direction of the first virtual object toward the first target and the first dispersion offset; the first virtual ammunition is controlled to fly along the first ballistic trajectory. Controlling the second virtual munition to fly along the second ballistic trajectory includes: The pseudo-random algorithm is used to determine the second dispersion offset from the second offset angle range; the second ballistic trajectory is generated based on the second aiming direction of the first virtual object toward the second target and the second dispersion offset; the second virtual ammunition is controlled to fly along the second ballistic trajectory. The maximum value of the first offset angle interval is greater than the maximum value of the second offset angle interval.
5. The method according to claim 3, characterized in that, Controlling the first virtual munition to fly along the first ballistic trajectory includes: Determine a first recoil offset that matches the first firing mode; generate a first ballistic trajectory based on the first aiming direction of the first virtual object toward the first target and the first recoil offset; control the first virtual ammunition to fly along the first ballistic trajectory; Controlling the second virtual munition to fly along the second ballistic trajectory includes: Determine the second recoil offset that matches the second firing mode; generate the second ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the second recoil offset; control the second virtual ammunition to fly along the second ballistic trajectory; Wherein, the first rear seat offset is greater than the second rear seat offset.
6. The method according to claim 1, characterized in that, The step of generating the j-th ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the j-th dispersion offset includes: Determine the j-th recoil offset that matches the j-th shot; The j-th ballistic trajectory is generated based on the second aiming direction of the first virtual object toward the second target, the j-th dispersion offset, and the j-th recoil offset; The step of generating the (j+1)th ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the (j+1)th dispersion offset includes: Determine the (j+1)th recoil offset matching the (j+1)th shot; generate the (j+1)th ballistic trajectory based on the second aiming direction of the first virtual object toward the second target, the (j+1)th dispersion offset, and the (j+1)th recoil offset; Wherein, the (j+1)th rear seat offset is equal to the jth rear seat offset.
7. The method according to any one of claims 1 to 5, characterized in that, The method further includes: In response to receiving a command to perform k firing operations, play an animation of the first virtual object bending the virtual hammer; After the animation finishes playing, during the p-th firing, the first virtual object is controlled to fire the p-th virtual ammunition at the second target using the virtual firearm in the second firing mode, and the p-th virtual ammunition is controlled to fly along the p-th ballistic trajectory. During the p+1th firing process, the first virtual object is controlled to fire the p+1th virtual ammunition at the second target using the virtual firearm in the second firing mode, and the p+1th virtual ammunition is controlled to fly along the p+1th ballistic trajectory. Wherein, if the p-th shot hits the second target, the probability of the (p+1)-th trajectory hitting the second target is higher than the probability of the p-th trajectory hitting the second target, k is a positive integer greater than 1, and p is a positive integer not greater than k.
8. A device for using a virtual firearm, characterized in that, The device includes: The display module is used to display a screen showing the first virtual object firing the virtual firearm in real time when the virtual firearm is in the first firing mode, in response to receiving the first firing operation. A switching module is used to switch the virtual firearm from the first firing mode to the second firing mode, wherein the hit rate of the first firing mode is lower than the hit rate of the second firing mode. The display module is further configured to, when the virtual firearm is in the second firing mode, respond to receiving an instruction to perform m firing operations, play the animation of the first virtual object turning the virtual hammer for the jth time before the jth firing; after the animation finishes playing, during the jth firing, determine the jth dispersion offset from the jth offset angle range using a pseudo-random algorithm; generate the jth ballistic trajectory based on the second aiming direction of the first virtual object toward the second target and the jth dispersion offset; and control the jth virtual ammunition to fly along the jth ballistic trajectory. Before the (j+1)th shot, an animation of the first virtual object turning the virtual hammer is played for the (j+1)th time; after the animation finishes playing, during the (j+1)th shot, the first virtual object is controlled to fire the (j+1)th virtual ammunition at the second target using the virtual firearm, and the (j+1)th dispersion offset is determined from the (j+1)th offset angle interval using the pseudo-random algorithm; the (j+1)th ballistic trajectory is generated based on the second aiming direction of the first virtual object toward the second target and the (j+1)th dispersion offset; the (j+1)th virtual ammunition is controlled to fly along the (j+1)th ballistic trajectory; wherein, the maximum value of the (j+1)th offset angle interval is equal to the maximum value of the (j)th offset angle interval; Wherein, the probability that the j-th trajectory hits the second target is equal to the probability that the (j+1)-th trajectory hits the second target, m is a positive integer greater than 1, and j is a positive integer not greater than m.
9. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the method of using the virtual firearm as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that is loaded and executed by a processor to implement the method of using the virtual firearm as described in any one of claims 1 to 7.
11. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium, and a processor retrieves the computer instructions from the computer-readable storage medium, causing the processor to load and execute them to implement the method of using the virtual firearm as described in any one of claims 1 to 7.