CN114225419B - Virtual prop control method, device, equipment, storage medium and program product - Google Patents

Virtual prop control method, device, equipment, storage medium and program product Download PDF

Info

Publication number
CN114225419B
CN114225419B CN202111655994.7A CN202111655994A CN114225419B CN 114225419 B CN114225419 B CN 114225419B CN 202111655994 A CN202111655994 A CN 202111655994A CN 114225419 B CN114225419 B CN 114225419B
Authority
CN
China
Prior art keywords
virtual
bullet
bullets
target
prop
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111655994.7A
Other languages
Chinese (zh)
Other versions
CN114225419A (en
Inventor
徐育通
姚丽
刘智洪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202111655994.7A priority Critical patent/CN114225419B/en
Publication of CN114225419A publication Critical patent/CN114225419A/en
Application granted granted Critical
Publication of CN114225419B publication Critical patent/CN114225419B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/57Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/64Methods for processing data by generating or executing the game program for computing dynamical parameters of game objects, e.g. motion determination or computation of frictional forces for a virtual car
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Abstract

The application provides a control method, a device, equipment, a computer readable storage medium and a computer program product of virtual props; the method comprises the following steps: in the picture of the virtual scene, presenting an operation control of the target virtual prop; the target virtual prop is used for shooting a target object; in response to a trigger instruction aiming at an operation control, controlling a target virtual prop to emit virtual bullets with target quantity, wherein the virtual bullets with the target quantity are composed of a first virtual bullet set and at least one second virtual bullet set; a process of shooting the target object by a virtual bullet presenting the target number; when the target number of virtual bullets is shot to the target object, the virtual bullets in the first virtual bullet set are in a circular area, and the virtual bullets in the second virtual bullet set are in a circular ring area at the periphery of the circular area. According to the virtual bullet shooting control method and device, the virtual bullet shot by the virtual prop can be controlled more accurately.

Description

Virtual prop control method, device, equipment, storage medium and program product
The application is provided with the application number of 202010879804.9, the application date of 2020, 08 and 27 days, and the name of the application is: a method, apparatus, device and computer readable storage medium for controlling virtual props are provided.
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, a computer readable storage medium, and a computer program product for controlling a virtual prop.
Background
In a virtual scene, different virtual props are usually provided, such as shooting props, magic props, armed props, etc. In the related art, the gun barrel of the shooting prop is thicker, the bullets are thick, the shooting sound is very loud, the muzzle diameter is between 12 and 20mm, the firepower is high, the killing surface is wide, and the gun is a high-efficiency weapon for near combat. In a virtual scene, the shooting prop is controlled to shoot once, multiple virtual bullets are shot out simultaneously, and the bullets are shot out within a circle according to a rule. By the control method, the randomness of the emission coefficient of each bullet is too strong, and the virtual bullets emitted by the virtual props cannot be accurately controlled.
Disclosure of Invention
Embodiments of the present application provide a method, apparatus, device, computer readable storage medium, and computer program product for controlling a virtual prop, which can more accurately control a virtual bullet emitted by the virtual prop.
The technical scheme of the embodiment of the application is realized as follows:
The embodiment of the application provides a control method of virtual props, which comprises the following steps:
in a picture of the virtual scene, presenting an operation control for the target virtual prop; the target virtual prop is used for shooting a target object;
controlling the target virtual prop to emit a target number of virtual bullets in response to a trigger instruction aiming at the operation control, wherein the target number of virtual bullets is composed of a first virtual bullet set and at least one second virtual bullet set;
a process of shooting the target object by a virtual bullet presenting the target number;
when the target number of virtual bullets is shot to the target object, the virtual bullets in the first virtual bullet set are in a circular area, and the virtual bullets in the second virtual bullet set are in a circular area at the periphery of the circular area.
The embodiment of the application provides a control device for virtual props, which comprises:
the first presentation module is used for presenting the operation control of the target virtual prop in the picture of the virtual scene; the target virtual prop is used for shooting a target object;
the control module is used for responding to a trigger instruction aiming at the operation control and controlling the target virtual prop to launch virtual bullets with target quantity, and the virtual bullets with the target quantity are composed of a first virtual bullet set and at least one second virtual bullet set;
A second presenting module, configured to present a process of shooting the target object by the virtual bullets with the target number;
when the target number of virtual bullets is shot to the target object, the virtual bullets in the first virtual bullet set are in a circular area, and the virtual bullets in the second virtual bullet set are in a circular area at the periphery of the circular area.
In the above scheme, the second presenting module is further configured to obtain a position of an aiming point for shooting the target object by the target virtual prop;
the position of the aiming point is used as a circle center, and the circular area and the annular area are determined on a plane where the target object is located;
presenting the bullet holes of the virtual bullets in the first virtual bullet set in the circular area, and
the bullet holes of the virtual bullets in the second virtual bullet set are presented in the annular region.
In the above scheme, the annular region comprises at least two sub-regions uniformly distributed in the annular region, and the sum of the areas of the at least two sub-regions is smaller than the area of the annular region;
the second presenting module is further configured to present, in at least two sub-areas of the annular area, the bullet holes of the virtual bullets in the second virtual bullet set, so that the virtual bullets in the second virtual bullet set are uniformly distributed in the at least two sub-areas.
In the above-mentioned scheme, the second presenting module is further configured to present, when the number of the second virtual bullet sets is two or more, bullet holes of virtual bullets in the corresponding second virtual bullet sets in the annular area corresponding to each second virtual bullet set, respectively;
wherein two or more annular regions corresponding to the two or more second virtual bullet sets are concentric rings, and the inner diameter of a first ring between two adjacent concentric rings is equal to the outer diameter of a second ring.
In the above scheme, the second presenting module is further configured to obtain a material corresponding to the target object in the virtual scene;
and displaying the bullet holes corresponding to the virtual bullets in the surface area of the target object through the bullet hole special effect corresponding to the material.
In the above solution, the second presenting module is further configured to present, in a surface area of the target object, a bullet hole corresponding to each virtual bullet;
and when the presentation duration of the corresponding bullet hole of the virtual bullet arrives, canceling the bullet hole of each virtual bullet to be presented.
In the above scheme, the second presenting module is further configured to obtain a firing coefficient of each virtual bullet according to a virtual bullet set to which each virtual bullet belongs, respectively;
Determining shooting directions of the virtual bullets according to the shooting coefficients of the virtual bullets respectively;
and presenting the virtual bullets of the target quantity, and shooting the target object along the corresponding shooting direction from the position of the target virtual bullets.
In the above scheme, the second presenting module is further configured to obtain a first emission coefficient range corresponding to the first virtual bullet set and a second emission coefficient range corresponding to the second virtual bullet set when the number of the second virtual bullet sets is one;
determining the emission coefficient of each virtual bullet in the first virtual bullet set according to the first emission coefficient range, and
and determining the emission coefficient of each virtual bullet in the second virtual bullet set according to the second emission coefficient range.
In the above solution, the second presenting module is further configured to obtain a first number of virtual bullets in the first virtual bullet set;
when the emission coefficient is represented by the coordinate values which are offset relative to the circle center in the circular area, selecting a first number of coordinate values based on the range of the emission coefficient, and
and taking the selected coordinate values as the emission coefficients of the virtual bullets in the first virtual bullet set.
In the above solution, the second presenting module is further configured to obtain a second number of virtual bullets in the first virtual bullet set;
when the emission coefficient is represented by the divergence angle generated by comparing the straight line from the target virtual prop to the center of the circular area, selecting a second number of values of the divergence angle based on the emission coefficient range, and
and taking the selected value of each divergence angle as the emission coefficient of each virtual bullet in the first virtual bullet set.
In the above solution, the second presenting module is further configured to, for the second virtual bullet set, obtain, according to an inner radius and an outer radius of the annular region, a random radius of each virtual bullet in the second virtual bullet set, so that the random radius is within a range from the inner radius to the outer radius;
sequentially acquiring random angles of all virtual bullets in the second virtual bullet set;
and determining the emission coefficient of each virtual bullet in the second virtual bullet set according to the random radius and the random angle.
In the above scheme, the second presenting module is further configured to obtain a position of an aiming point for shooting the target object by the target virtual prop, and a position of the target virtual prop;
Acquiring shooting positions of the virtual bullets according to the positions of the aiming points and the shooting coefficients of the virtual bullets;
and respectively determining the direction from the position of the target virtual prop to the shooting position of each virtual bullet as the shooting direction of each virtual bullet.
An embodiment of the present application provides an electronic device, including:
a memory for storing executable instructions;
and the processor is used for realizing the control method of the virtual prop provided by the embodiment of the application when executing the executable instructions stored in the memory.
The embodiment of the application provides a computer readable storage medium which stores executable instructions for realizing the control method of the virtual prop provided by the embodiment of the application when being executed by a processor.
The embodiment of the application provides a computer program product, which comprises a computer program or instructions, wherein the computer program or instructions realize the control method of the virtual prop provided by the embodiment of the application when being executed by a processor.
The embodiment of the application has the following beneficial effects:
the method comprises the steps of responding to a trigger instruction aiming at an operation control, controlling a target virtual prop to launch virtual bullets with target quantity, wherein the virtual bullets with the target quantity are composed of a first virtual bullet set and at least one second virtual bullet set; a process of shooting the target object by presenting a virtual bullet of a target number; when the virtual bullets of the target number are shot to the target object, the virtual bullets in the first virtual bullet set are positioned in a circular area, and the virtual bullets in the second virtual bullet set are positioned in a circular ring area at the periphery of the circular area; therefore, as the virtual bullets of the target number are divided into at least two virtual bullet sets and the virtual bullet sets are dispersed into different areas, the randomness of the emission coefficient of the virtual bullets is reduced, and the accuracy of controlling the virtual bullet shooting is further improved.
Drawings
FIG. 1 is a schematic view of a bullet hole provided in the related art for controlling shooting of virtual props;
FIG. 2 is a schematic diagram of a bullet hole provided in the related art for controlling the firing of a virtual prop;
FIG. 3 is a schematic diagram of a control system for virtual props according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 5 is a flow chart of a method for controlling a virtual prop according to an embodiment of the present application;
fig. 6 is a schematic view of the ejection direction of a virtual bullet provided in an embodiment of the present application;
FIGS. 7A-7B are schematic views of a bullet hole for controlling the firing of a virtual prop provided by embodiments of the present application;
FIG. 8 is a schematic diagram of a bullet hole for controlling shooting of virtual props provided in an embodiment of the present application;
FIG. 9 is a schematic illustration of a bullet hole presenting a virtual bullet provided by an embodiment of the present application;
FIG. 10 is a schematic view of a bullet hole of a current virtual bullet provided in an embodiment of the present application;
FIG. 11 is a schematic diagram illustrating material selection according to an embodiment of the present disclosure;
FIG. 12 is a schematic diagram of circular area division provided by an embodiment of the present application;
FIG. 13 is a schematic view of a variation of the bottom guard circular area provided in an embodiment of the present application;
FIG. 14 is a schematic view of an annular region provided by an embodiment of the present application;
15A-15B are schematic diagrams of region division provided by embodiments of the present application;
FIG. 16 is a flow chart of a method for controlling a virtual prop provided in an embodiment of the present application;
fig. 17A-17D are schematic diagrams of bullet hole presentations provided in embodiments of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the present application will be described in further detail with reference to the accompanying drawings, and the described embodiments should not be construed as limiting the present application, and all other embodiments obtained by those skilled in the art without making any inventive effort are within the scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict.
In the following description, the terms "first", "second", "third" and the like are merely used to distinguish similar objects and do not represent a particular ordering of the objects, it being understood that the "first", "second", "third" may be interchanged with a particular order or sequence, as permitted, to enable embodiments of the application described herein to be practiced otherwise than as illustrated or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the present application.
Before further describing embodiments of the present application in detail, the terms and expressions that are referred to in the embodiments of the present application are described, and are suitable for the following explanation.
1) And a client, an application program for providing various services, such as a video playing client, a game client, etc., running in the terminal.
2) In response to a condition or state that is used to represent the condition or state upon which the performed operation depends, the performed operation or operations may be in real-time or with a set delay when the condition or state upon which it depends is satisfied; without being specifically described, there is no limitation in the execution sequence of the plurality of operations performed.
3) The virtual scene is a virtual scene that an application program displays (or provides) when running on a terminal. The virtual scene may be a simulation environment for the real world, a semi-simulation and semi-fictional virtual environment, or a pure fictional virtual environment. The virtual scene may be any one of a two-dimensional virtual scene, a 2.5-dimensional virtual scene or a three-dimensional virtual scene, and the dimension of the virtual scene is not limited in the embodiment of the present application. For example, a virtual scene may include sky, land, sea, etc., the land may include environmental elements of a desert, city, etc., and a user may control a virtual object to move in the virtual scene.
4) Virtual objects, images of various people and objects in a virtual scene that can interact, or movable objects in a virtual scene. The movable object may be a virtual character, a virtual animal, a cartoon character, etc., such as: characters, animals, plants, oil drums, walls, stones, etc. displayed in the virtual scene. The virtual object may be an avatar in the virtual scene for representing a user. A virtual scene may include a plurality of virtual objects, each virtual object having its own shape and volume in the virtual scene, occupying a portion of space in the virtual scene.
Alternatively, the virtual object may be a user Character controlled by an operation on the client, an artificial intelligence (AI, artificial Intelligence) set in the virtual scene fight by training, or a Non-user Character (NPC) set in the virtual scene interaction. Alternatively, the virtual object may be a virtual character that performs an antagonistic interaction in the virtual scene. Optionally, the number of virtual objects participating in the interaction in the virtual scene may be preset, or may be dynamically determined according to the number of clients joining the interaction.
Taking shooting games as an example, a user may control a virtual object to freely fall, glide or open a parachute to fall in the sky of the virtual scene, run, jump, crawl, bend down and advance on land, or control the virtual object to swim, float or dive in the ocean, or the like, and of course, the user may control the virtual object to move in the virtual scene by taking a virtual carrier, for example, the virtual carrier may be a virtual automobile, a virtual aircraft, a virtual yacht, or the like, and only the above scenes are exemplified. The user may also control the virtual object to perform an antagonistic interaction with other virtual objects through a virtual prop, for example, the virtual prop may be a throwing type virtual prop such as a grenade, a cluster grenade, a viscous grenade, or a shooting type virtual prop such as a machine gun, a pistol, a rifle, etc., and the type of the virtual prop is not particularly limited in this application.
5) The random angle refers to an angle obtained randomly in a certain angle range, for example, an angle can be randomly selected from an angle range of 0 to 360 degrees and is used as a random angle.
In the related art, there is provided a control method of a virtual prop, in which when a user presses a "firing key", a circular area having a radius R is determined with a position of an aiming point as a center of a circle, and a plurality of random points are determined in the circular area according to the number of virtual bullets, each random point corresponds to one virtual bullet, that is, the virtual bullet is shot to a position where the corresponding random point is located.
For example, when a user presses the "fire button", 8 virtual bullets are shot by the virtual prop, fig. 1 is a schematic diagram of a bullet hole provided in the related art for controlling the shooting of the virtual prop, and referring to fig. 1, the shot 8 virtual bullets are located in a circular area, and the virtual bullets are distributed around the circle, that is, the virtual bullets are distributed in the circular area without regularity, some areas are very concentrated, and some areas have no bullets.
In the implementation process of the embodiment of the application, it is found that in the related technology, as the distribution of the shot virtual bullets is completely random, the damage of the virtual props is unstable, and the virtual bullets shot by the virtual props cannot be accurately controlled.
For example, fig. 2 is a schematic diagram of a bullet hole for controlling shooting of a virtual prop provided in the related art, referring to fig. 2, although a target virtual object is located in a circular area, none of the bullets shoots the target virtual object, resulting in low controllability of the virtual bullets and uncontrollable number of bullets. That is, in the related art, when a user controls a virtual prop to shoot a target virtual object, all of the shot 8 bullets may hit the target virtual object or all of the shot 8 bullets may not hit the target virtual object.
Referring to fig. 3, fig. 3 is a schematic architecture diagram of a virtual prop control system 100 according to an embodiment of the present application, in order to support an exemplary application, a terminal (a terminal 400-1 and a terminal 400-2 are shown in an exemplary manner) are connected to a server 200 through a network 300, where the network 300 may be a wide area network or a local area network, or a combination of the two.
The terminal is used for presenting an operation control of the target virtual prop in the picture of the virtual scene; receiving a trigger instruction for an operation control; sending an acquisition request of the shooting direction of the virtual bullet to a server according to the trigger instruction; the target virtual prop is used for shooting a target object, and aiming at a trigger instruction of the operation control, the target virtual prop is used for indicating the target virtual prop to shoot virtual bullets of target quantity; the server 200 is configured to obtain a shooting direction of a target number of virtual bullets according to a position of an aiming point of a target object shot by the target virtual prop; the terminal is also used for presenting the virtual bullets of the target quantity, and shooting the target objects along the corresponding shooting directions from the positions of the target virtual props; when the target number of virtual bullets is shot to the target object, the virtual bullets in the first virtual bullet set are in a circular area, and the virtual bullets in the second virtual bullet set are in a circular ring area at the periphery of the circular area.
In some embodiments, the server 200 may be a stand-alone physical server, a server cluster or a distributed system formed by a plurality of physical servers, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs, content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc. The terminal and the server may be directly or indirectly connected through wired or wireless communication, which is not limited in the embodiment of the present invention.
In actual implementation, the terminal installs and runs an application program supporting a virtual scene. The application may be any one of a First person shooter game (FPS, first-Person Shooting game), a third person shooter game, a multiplayer online tactical competition game (MOBA, multiplayer Online Battle Arena game s), a virtual reality application, a three-dimensional map program, or a multiplayer gunfight survival game. A user uses a terminal to operate a virtual object located in a virtual scene to perform activities including, but not limited to: adjusting at least one of body posture, crawling, walking, running, riding, jumping, driving, picking up, shooting, attacking, throwing. Illustratively, the virtual object is a virtual character, such as an emulated persona or a cartoon persona.
In an exemplary scenario, a virtual object controlled by the terminal 400-1 (hereinafter referred to as a first virtual object) and a virtual object controlled by the other terminal 400-2 (hereinafter referred to as a second virtual object) are in the same virtual scenario, where the first virtual object may interact with the second virtual object in the virtual scenario. In some embodiments, the first virtual object and the second virtual object may be hostile, e.g., the first virtual object and the second virtual object belong to different teams and organizations, and the hostile virtual objects may be opponent-type interacted with each other on land in a shooting manner.
In an exemplary scenario, when the terminal 400 controls the first virtual object to attack the second virtual object, an object interaction interface obtained by observing the virtual scenario from the perspective of the first virtual object is presented on the terminal, and an operation control of at least one target virtual prop is presented in the object interaction interface; when the operation control is in an activated state, responding to triggering operation aiming at the operation control, and controlling the target virtual props to emit virtual bullets with target quantity, wherein the virtual bullets with the target quantity are composed of a first virtual bullet set and at least one second virtual bullet set; a process of shooting the target object by a virtual bullet presenting the target number; when the target number of virtual bullets is shot to the target object, the virtual bullets in the first virtual bullet set are in a circular area, and the virtual bullets in the second virtual bullet set are in a circular ring area at the periphery of the circular area.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an electronic device provided in an embodiment of the present application, and the electronic device shown in fig. 4 includes: at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. The various components in the electronic device are coupled together by a bus system 440. It is understood that the bus system 440 is used to enable connected communication between these components. The bus system 440 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration the various buses are labeled in fig. 4 as bus system 440.
The processor 410 may be an integrated circuit chip having signal processing capabilities such as a general purpose processor, such as a microprocessor or any conventional processor, or the like, a digital signal processor (DSP, digital Signal Processor), or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like.
The user interface 430 includes one or more output devices 431, including one or more speakers and/or one or more visual displays, that enable presentation of the media content. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
Memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard drives, optical drives, and the like. Memory 450 optionally includes one or more storage devices physically remote from processor 410.
Memory 450 includes volatile memory or nonvolatile memory, and may also include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read Only Memory (ROM), and the volatile Memory may be a random access Memory (RAM, random Access Memory). The memory 450 described in the embodiments herein is intended to comprise any suitable type of memory.
In some embodiments, memory 450 is capable of storing data to support various operations, examples of which include programs, modules and data structures, or subsets or supersets thereof, as exemplified below.
An operating system 451 including system programs, e.g., framework layer, core library layer, driver layer, etc., for handling various basic system services and performing hardware-related tasks, for implementing various basic services and handling hardware-based tasks;
network communication module 452 for reaching other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 include: bluetooth, wireless compatibility authentication (WiFi), and universal serial bus (USB, universal Serial Bus), etc.;
A presentation module 453 for enabling presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 431 (e.g., a display screen, speakers, etc.) associated with the user interface 430;
an input processing module 454 for detecting one or more user inputs or interactions from one of the one or more input devices 432 and translating the detected inputs or interactions.
In some embodiments, the control device for a virtual prop provided in the embodiments of the present application may be implemented in software, and fig. 4 shows a control device 455 for a virtual prop stored in a memory 450, which may be software in the form of a program and a plug-in, and includes the following software modules: the first presentation module 4551, the control module 4552 and the second presentation module 4553 are logical, and thus may be arbitrarily combined or further split according to the implemented functions, and the functions of the respective modules will be described below.
In other embodiments, the apparatus provided by the embodiments of the present application may be implemented in hardware, and by way of example, the apparatus provided by the embodiments of the present application may be a processor in the form of a hardware decoding processor that is programmed to perform the method for controlling virtual props provided by the embodiments of the present application, e.g., the processor in the form of a hardware decoding processor may employ one or more application specific integrated circuits (ASIC, application Specific Integrated Circuit), DSPs, programmable logic devices (PLD, programmable Logic Device), complex programmable logic devices (CPLD, complex Programmable Logic Device), field programmable gate arrays (FPGA, field-Programmable Gate Array), or other electronic components.
The control method of the virtual prop provided by the embodiment of the application will be described with reference to the exemplary application and implementation of the terminal provided by the embodiment of the application.
Referring to fig. 5, fig. 5 is a flowchart of a method for controlling a virtual prop according to an embodiment of the present application, and will be described with reference to the steps shown in fig. 5.
Step 501: and the terminal presents the operation control of the target virtual prop in the picture of the virtual scene.
The target virtual prop is used for shooting the target object.
In some embodiments, the terminal has installed and running thereon an application supporting a virtual scene. The application may be any one of a first person shooter game, a third person shooter game, a multiplayer online tactical game, a virtual reality application, a three-dimensional map program, or a multiplayer gunfight survival game. A user may use a terminal to operate a virtual object located in a virtual scene to perform activities including, but not limited to: adjusting at least one of body posture, crawling, walking, running, riding, jumping, driving, picking up, shooting, attacking, throwing. Illustratively, the virtual object is a virtual character, such as an emulated persona or a cartoon persona.
The target virtual prop is a virtual shooting prop, and the operation control is used for controlling the target virtual prop to shoot in the virtual scene when receiving the trigger instruction. In actual implementation, the operation control may be presented in the form of an icon, a button, or the like, for example, the operation control may be a firing button.
In some embodiments, a target virtual prop may also be presented in the picture of the virtual scene, e.g., a virtual object may be presented in the picture of the virtual scene and the target virtual prop presented in the hand position of the virtual object; the virtual prop status bar can be displayed in the picture of the virtual scene, and the target virtual prop is presented in the virtual prop status bar; the target virtual prop for shooting the target object may also be presented in other ways.
Step 502: and responding to a trigger instruction aiming at the operation control, and controlling the target virtual prop to emit virtual bullets with the target number.
Here, the target number of virtual bullets is constituted by a first set of virtual bullets and at least one second set of virtual bullets.
In actual implementation, the number of bullets in the first virtual bullet set and the second virtual bullet set is preset by a planner; the triggering instruction aiming at the target virtual prop can control the virtual object to shoot in the virtual scene by using the target virtual prop.
In practical application, the triggering mode of the triggering instruction can be at least one of clicking, double clicking, long pressing and sliding aiming at the operation control.
Step 503: a process of shooting the target object by virtual bullets with the target number is presented.
Here, when a target number of virtual bullets is shot to the target object, the virtual bullets in the first virtual bullet set are in a circular area, and the virtual bullets in the second virtual bullet set are in a circular area surrounding the circular area.
In actual practice, a target number of virtual bullets are ejected from the muzzle simultaneously.
In some embodiments, the process of shooting a target object by a virtual bullet of a target number may be presented by: respectively acquiring the emission coefficient of each virtual bullet according to the virtual bullet set to which each virtual bullet belongs; determining shooting directions of the virtual bullets according to the shooting coefficients of the virtual bullets respectively; and (3) presenting virtual bullets of the target quantity, and shooting the target object along the corresponding shooting direction from the position of the target virtual props.
The embodiment of the application performs sectional control on the emission coefficient of the virtual bullet, namely, configures different emission coefficient ranges and/or determination rules of the emission coefficient for different virtual bullet sets. In practical implementation, the position of the target virtual prop refers to the position of the muzzle of the target virtual prop in the virtual scene, that is, the position of each virtual bullet from the muzzle is presented, and the process of shooting the target object along the corresponding design direction is performed.
In some embodiments, the firing coefficient of each virtual bullet may be obtained by: when the number of the second virtual bullet sets is one, a first emission coefficient range corresponding to the first virtual bullet set and a second emission coefficient range corresponding to the second virtual bullet set are obtained; according to the first emission coefficient range, the emission coefficient of each virtual bullet in the first virtual bullet set is determined, and according to the second emission coefficient range, the emission coefficient of each virtual bullet in the second virtual bullet set is determined, so that the emission coefficient of each virtual bullet is obtained.
Here, the first emission coefficient range does not intersect with the second emission coefficient range.
In practical implementation, a range of emission coefficients is set for the first virtual bullet set and the second virtual bullet set respectively, wherein the first range of emission coefficients corresponds to the circular area, and the second range of emission coefficients corresponds to the annular area.
When the emission coefficient is represented by a coordinate value which is shifted relative to the circle center in the circular area, determining a first emission coefficient range based on the size of the circular area; a second range of emission coefficients is determined based on the size of the annular region.
When the emission coefficient is represented by a divergence angle, determining a first emission coefficient range based on the size of the circular area and the distance from the target virtual prop to the center of the circular area; and determining based on the first emission coefficient range, the size of the annular excircle and the distance from the target virtual prop to the center of the circular area. Wherein the center of the circular area is the location of the aiming point.
In some embodiments, the firing coefficients for each virtual bullet in the first set of virtual bullets may be obtained by: acquiring a first number of virtual bullets in a first virtual bullet set; when the emission coefficient is represented by coordinate values which are offset relative to the circle center in the circular area, a first number of coordinate values are selected based on the emission coefficient range, and each coordinate value is selected as the emission coefficient of each virtual bullet in the first virtual bullet set.
When the emission coefficient is represented by the coordinate value which is shifted relative to the center of the circle in the circular area, the range of the emission coefficient corresponds to the circular area, and in actual implementation, a first number of points are obtained from the circular area, and the coordinate value which is shifted relative to the center of the circle is used as the emission coefficient of each virtual bullet in the first virtual bullet set.
Here, the first number of points may be obtained from the circular area, or the first number of points may be obtained completely randomly from the circular area, or the first number of points may be obtained according to a certain rule, for example, the circular area may be divided into the first number of areas according to a certain rule, and each point may be obtained randomly from each of the divided areas.
In some embodiments, the firing coefficients for each virtual bullet in the first set of virtual bullets may be obtained by: and sequentially determining the emission coefficients of the virtual bullets in the first virtual bullet set according to a certain processing sequence.
In actual implementation, according to the processing sequence, sub-circular areas corresponding to the virtual bullets in the first virtual bullet set are sequentially obtained, a random point is obtained from the sub-circular areas, and the coordinates of the random point are used as the emission coefficients of the corresponding virtual bullets.
The radius of the sub-round area is not larger than that of the round area, and the radius of the sub-round area corresponds to the processing sequence of the corresponding virtual bullets.
In practical application, the more forward the processing sequence of the virtual bullets is, the smaller the radius of the corresponding sub-circular area is, and the more accurate the shooting position of the virtual bullets is; the more the processing sequence of the virtual bullets is, the larger the radius of the corresponding sub-circular area is, and the less accurate the shooting position of the virtual bullets is.
In some embodiments, the coordinate values of the random points in the circular region may be determined by m_shotsread=random.
In some embodiments, the firing coefficients for each virtual bullet in the first set of virtual bullets may be obtained by: acquiring a second number of virtual bullets in the first virtual bullet set; when the emission coefficient is represented by the divergence angle generated by comparing the straight line from the target virtual prop to the circle center of the circular area, selecting the value of a second number of divergence angles based on the emission coefficient range, and taking the value of each selected divergence angle as the emission coefficient of each virtual bullet in the first virtual bullet set.
In practical implementation, when the emission coefficient is represented by the divergence angle generated by comparing the emission coefficient with the straight line from the target virtual prop to the center of the circle, the value of the second number of divergence angles can be randomly selected from the emission coefficient range to serve as the emission coefficient of each virtual bullet in the first virtual bullet set.
In some embodiments, a random point may be obtained in the circular area, and a first line between the random point and the location of the target virtual prop is determined, and a second line between the center of the circular area and the location of the target virtual prop is determined, where an angle between the first line and the second line is a value of a divergence angle, and the value is used as a coefficient of emission of the virtual bullet.
In some embodiments, the firing coefficient of each virtual bullet may be obtained by:
for the second virtual bullet set, according to the inner radius and the outer radius of the annular area, acquiring the random radius of each virtual bullet in the second virtual bullet set so that the random radius is in the range from the inner radius to the outer radius; sequentially acquiring random angles of all virtual bullets in a second virtual bullet set; and determining the emission coefficient of each virtual bullet in the second virtual bullet set according to the random radius and the random angle.
In practical implementation, the random radius should be larger than the inner radius and smaller than the outer radius, for example, the inner radius is 3 and the outer radius is 5, and then the random radius should be randomly valued within the range of (3, 5).
In some embodiments, the random angle of each virtual bullet in the second set of virtual bullets may be obtained by:
acquiring the random angle acquisition sequence of each virtual bullet in the second virtual bullet set; according to the acquisition sequence, the following operations are sequentially executed on each virtual bullet in the second virtual bullet set: according to the acquisition sequence, when the virtual bullet is determined to be the first virtual bullet, acquiring a random angle interval, and acquiring a random angle of the virtual bullet from the random angle interval; and when the virtual bullet is not the first virtual bullet according to the acquisition sequence, acquiring an initial random angle from the random angle interval, and superposing the initial random angle with a target angle to obtain the random angle of the virtual bullet, wherein the target angle is determined according to the acquisition sequence of the virtual bullet.
In practical implementation, when the virtual bullet is the first bullet in the second virtual bullet set, firstly randomly generating an angle value from an angle range of 0 to 360 degrees, and taking the angle value as a starting angle; then, the starting angle is superimposed with the configured range, so that a random angle interval can be obtained, for example, the starting angle is 70, the configured range is (0, 20), and then the random angle interval is (70, 90). After the random angle interval is obtained, an angle value is randomly generated from the random angle interval as the random angle of the first bullet.
Here, a random starting angle can be obtained by the following algorithm:
StartAngle=Random.Range(0,360);
wherein StartAngle represents a random starting angle, range (0, 360) represents an angle range from 0 to 360 degrees, and an angle value is randomly generated.
In some embodiments, the random angle of the first virtual bullet may be determined by the following algorithm:
angle=Random.Range(0,m_AngleUncertainty)+StartAngle,
where (0, m_angle noncerty) represents the range of configuration; random (0, m_angle Uncertainetry) represents randomly generating an angle value from the configured range; startAngle represents the starting angle.
In actual implementation, when the virtual bullet is not the first virtual bullet, determining a target angle according to the acquisition sequence of the virtual bullet and the equal division intervals; and then, superposing the initial random angle and the target angle to obtain the random angle of the virtual bullet.
For example, the annular region is divided into six equal divisions, each equal division being 60 degrees. The target angle is obtained by multiplying the equally divided intervals by the acquisition sequence of the virtual bullets, for example, the target angle corresponding to the second bullet in the second virtual bullet set is 60 degrees, and the target angle corresponding to the third bullet in the second virtual bullet set is 180 degrees.
Assuming that the current virtual bullet is the second bullet in the second virtual bullet set, the angle interval is (70, 90), and the initial random angle obtained from the angle interval is 78 degrees, then the random angle is 78+60=138; the current virtual bullet is the third bullet in the second virtual bullet set, the angle interval is (70, 90), the initial random angle obtained from the angle interval is 80 degrees, then the random angle is 80+120=200.
In some embodiments, the firing coefficient of each virtual bullet may be obtained by: for each virtual bullet in the second virtual bullet set, the following operations are respectively executed: acquiring sine values and cosine values of random angles of the virtual bullets; taking the product of the cosine value and the random radius as an abscissa; taking the product of the sine value and the random radius as an ordinate; two-dimensional vectors expressed by the abscissa and the ordinate are determined as the firing coefficients of the corresponding virtual bullets.
In actual implementation, the firing coefficient of the virtual bullet can be calculated by the following formula:
float rad=angle*(Mathf.PI*2/360);
float x=r*Mathf.Cos(rad);
float y=r*Mathf.Sin(rad);
m_shotSpread=new Vector2(x,y);
where rad denotes the stacking angle, r denotes the random radius, and m_shotsread denotes the emission coefficient.
In some embodiments, the firing direction of each virtual bullet may be obtained by: acquiring the position of an aiming point for shooting a target object by a target virtual prop and the position of the target virtual prop; acquiring shooting positions of the virtual bullets according to the positions of the aiming points and the shooting coefficients of the virtual bullets; and respectively determining the direction from the position of the target virtual prop to the shooting position of each virtual bullet as the shooting direction of each virtual bullet.
In practical implementation, when the emission coefficient is represented by the coordinate value of the deviation of the emission coefficient relative to the circle center in the circular area, the emission coefficient of the virtual bullet is overlapped by the position of the aiming point, so that the shooting position of the virtual bullet can be obtained, and then the direction from the position of the target virtual prop to the shooting position of each virtual bullet can be determined, and the shooting direction of each virtual bullet is the shooting direction of each virtual bullet.
For example, fig. 6 is a schematic view of the ejection direction of the virtual bullet provided in the embodiment of the present application, referring to fig. 6, if the virtual bullet is not ejected, the virtual bullet is ejected in the direction indicated by the arrow 601, which is the direction indicated by the muzzle, that is, the direction of the aiming point; the direction indicated by the arrow 602 is the shooting direction of the virtual bullet, and the offset of the point pointed by the arrow 602 relative to the point pointed by the arrow 601 is the emission coefficient.
In some embodiments, the terminal may also obtain a location of an aiming point for the target virtual prop to shoot the target object; determining a circular area and an annular area on a plane where a target object is positioned by taking the position of an aiming point as a circle center; the holes of the virtual bullets in the first virtual bullet set are presented in the circular area, and the holes of the virtual bullets in the second virtual bullet set are presented in the annular area.
Here, the plane includes the surface of the target object, for example, when the target object is a virtual character, the plane is the plane where the face of the character facing the target virtual prop is located; when the target object is a wall, the plane is the wall.
It should be noted that the ejected virtual bullet is in an area that may cover a plurality of objects, for example, by covering a virtual character and a virtual wall, and then the corresponding bullet hole is presented on the plane where each object is located.
In practical implementation, the circular area and the annular area may be adjacent or not, for example, fig. 7A-7B are schematic views of a bullet hole for controlling shooting of a virtual prop provided in an embodiment of the present application, see fig. 7A, where the circular area 701 presents a bullet hole of a virtual bullet in a first virtual bullet set, and the annular area 702 presents a bullet hole of a virtual bullet in a second virtual bullet set, where the circular area 701 is not adjacent to the annular area 702; referring to fig. 7B, the holes of the virtual bullets in the first virtual bullet set are presented in a circular area 703 and the holes of the virtual bullets in the second virtual bullet set are presented in an annular area 704, wherein the circular area 703 is adjacent to the annular area 704.
In some embodiments, the annular region comprises at least two sub-regions uniformly distributed in the annular region, and the sum of the areas of the at least two sub-regions is less than the area of the annular region; the bullet holes of the virtual bullets in the second virtual bullet set may be presented by: in at least two sub-areas of the annular area, the holes of the virtual cartridges of the second set of virtual cartridges are presented such that the virtual cartridges of the second set of virtual cartridges are evenly distributed in the at least two sub-areas.
In practical implementation, in order to avoid a situation that the bullet holes of the virtual bullets are concentrated in a certain area, the embodiment of the application determines at least two evenly distributed sub-areas in the annular area, and the bullet holes of the virtual bullets in the second virtual bullet set are presented in at least two sub-areas.
For example, fig. 8 is a schematic view of a bullet hole for controlling shooting of a virtual prop provided in an embodiment of the present application, referring to fig. 8, the annular area includes 6 sub-areas, and the 6 sub-areas are uniformly distributed in the annular area, and each sub-area has one bullet hole, that is, virtual bullets in the second virtual bullet set, which are uniformly distributed in the 6 sub-areas.
In some embodiments, the second set of virtual bullets has a one-to-one correspondence with the annular region; presenting the bullet holes of the virtual bullets in the second virtual bullet set in the annular region, comprising:
when the number of the second virtual bullet sets is two or more, the bullet holes of the virtual bullets in the corresponding second virtual bullet sets are respectively presented in the circular ring areas corresponding to the second virtual bullet sets; wherein two or more annular regions corresponding to two or more second virtual bullet sets are concentric rings, and the inner diameter of a first ring between two adjacent concentric rings is equal to the outer diameter of a second ring.
In actual practice, when the number of second virtual bullet sets is two or more, they are respectively. For example, fig. 9 is a schematic diagram of a bullet hole presenting a virtual bullet provided in an embodiment of the present application, referring to fig. 9, a first ring 901 is adjacent to a second ring 902, and bullet holes presenting corresponding second virtual bullet sets in the first ring area and the second ring area, respectively.
In some embodiments, the terminal may further obtain a material corresponding to the target object in the virtual scene; and displaying the bullet holes corresponding to the virtual bullets in the surface area of the target object through the bullet hole special effect corresponding to the material.
Here, each obstacle is hung with a collision box made of different materials to represent the corresponding materials, and different bullet hole special effects are set for different materials.
In practical implementation, for each virtual bullet, after determining the firing direction of the virtual bullet, a ray is shot with the position of the muzzle as the starting point, the direction of the ray is the determined firing direction of the virtual bullet, after detecting the physical collision box, the material of the physical collision box is determined, and the bullet hole special effect corresponding to the material is determined, so that the bullet hole of the corresponding virtual bullet is presented through the determined bullet hole special effect.
For example, fig. 10 is a schematic diagram of a bullet hole presenting a virtual bullet, see fig. 10, where each obstacle is hung with a collision box made of different materials, different bullet hole special effects are generated according to different materials, and the bullet hole shown in fig. 10 corresponds to the stone material.
Fig. 11 is a schematic view of material selection provided in an embodiment of the present application, and referring to fig. 11, the embodiment of the present application provides a plurality of different materials including grass, ice, fabric, water, etc., where stone is selected as the material.
In some embodiments, the terminal may also present the bullet holes corresponding to each virtual bullet at the surface area of the target object; and when the presentation duration of the corresponding bullet hole of the virtual bullet arrives, canceling the bullet hole of each virtual bullet to be presented.
In actual implementation, when the virtual bullets are shot to the surface area of the target object, the bullets corresponding to the virtual bullets are displayed on the surface area of the target object, timing is started, whether the display duration of the bullets corresponding to the virtual bullets is reached is judged according to the timing, if yes, the bullets of the virtual bullets are canceled, otherwise, the bullets of the virtual bullets are continuously displayed.
It should be noted that, when the time for each virtual bullet to reach the surface area of the target object is different, the time for canceling the presentation of the bullet hole of each virtual bullet is also different, that is, a timer may be set for each virtual bullet to determine whether the presentation duration of the bullet hole of the corresponding virtual bullet is reached.
The method comprises the steps of responding to a triggering instruction aiming at a target virtual prop, controlling the target virtual prop to launch virtual bullets with target quantity, wherein the virtual bullets with the target quantity are composed of a first virtual bullet set and at least one second virtual bullet set; a process of shooting the target object by a virtual bullet presenting the target number; when the virtual bullets of the target number are shot to the target object, the virtual bullets in the first virtual bullet set are positioned in a circular area, and the virtual bullets in the second virtual bullet set are positioned in a circular ring area at the periphery of the circular area; therefore, as the virtual bullets of the target number are divided into at least two virtual bullet sets and the virtual bullet sets are dispersed into different areas, the randomness of the emission coefficient of the virtual bullets is reduced, and the accuracy of controlling the virtual bullet shooting is further improved.
In the following, an exemplary application of the embodiments of the present application in a practical application scenario will be described. The virtual prop of target in this embodiment is the shotgun, and the barrel of the shotgun is thicker, and the bullet is thick, and the sound is very big when shooting. The caliber of the gun is between 12 and 20mm, the firepower is large, the killing surface is wide, and the gun is a high-efficiency weapon for near combat. In a virtual scenario, a shot gun firing at a time can fire multiple virtual bullets simultaneously, and each virtual bullet can be shot out in a circular area according to rules. Because the randomness of the virtual bullet emission is too strong, the user is not beneficial to grasp the attack hand feeling of the shotgun shooting prop, and based on the attack hand feeling, the control method of the virtual prop provided by the embodiment of the application is provided.
According to the embodiment of the application, the emission coefficients of the virtual bullets are controlled in a segmented mode, and the main idea is that the emission coefficients are controlled to be in circular areas with different radiuses, namely, emission values are dispersed into a plurality of circular areas; after the different radius ranges are determined, an arc range is randomly acquired, so that damage to the shotgun shooting prop is expected to be more stable on the basis of guaranteeing the randomness of virtual bullet shooting.
In practical application, three circular areas with different radii are determined, and the centers of the three circular areas are the same, fig. 12 is a schematic diagram of division of the circular areas provided in the embodiment of the present application, and referring to fig. 12, three circular areas are shown in fig. 12, which correspond to the bottom-protecting circular area 1201, the minimum circular area 1202, and the maximum circular area 1203, respectively. The virtual bullets of the target number shot at one time are divided into two virtual bullet sets, the emission coefficients of the virtual bullets in the first virtual bullet set are randomly generated only in a bottom-protected circular area, and the virtual bullets in the second virtual bullet set are randomly generated in an annular area except for a minimum circular area in a maximum circular area.
In practical implementation, fig. 13 is a schematic diagram of a change of a bottom-protecting round area provided in the embodiment of the present application, referring to fig. 13, in a process of determining a firing coefficient of each virtual bullet in the first virtual bullet set, a radius of the bottom-protecting round area may be increased according to an increase of the number of virtual bullets processed until the radius of the bottom-protecting round area is the same as a radius of the minimum round area, that is, a radius of a bottom-protecting round area corresponding to a last bullet in the first virtual bullet set is the same as a radius of the minimum round area.
That is, the emission coefficients of the virtual bullets in the first virtual bullet set are sequentially determined according to a certain processing sequence, wherein the closer the processing sequence of the virtual bullets is, the smaller the radius of the corresponding bottom-protecting circular area is, and the more accurate the shooting position of the virtual bullets is; the more the processing sequence of the virtual bullets is, the larger the radius which is determined first, and the less accurate the shooting position of the virtual bullets.
In practical implementation, fig. 14 is a schematic view of an annular region provided in the embodiment of the present application, referring to fig. 8, virtual bullets in the second virtual bullet set are randomly generated in the annular region 1401, where the white region is a minimum circular region 1402, and the white region and the annular region together form a maximum circular region.
To avoid the situation that virtual bullets are concentrated in a certain area, the embodiment of the application adopts a halving random generation mode to generate random values in an annular area.
For example, fig. 15A-15B are schematic views of the area division provided in the embodiment of the present application, referring to fig. 15A-15B, an angular position 1501 is selected first, then the annular area is divided into six halves according to the angular position, then the first virtual bullet in the second virtual bullet set is randomly generated in the area 1502, then the second virtual bullet randomly generates a value from the area 1502, and then an angle value of one half is increased, so that the emission value of the virtual bullet falls into the area in the second half; the third virtual bullet randomly generates a value from the region 1502 and then increases the angle value of the two halves, and so on, so that all the bullets in the second virtual bullet set are distributed in six halves of the region, where the size of the region 1502 field is configurable.
The following describes a control method of a virtual prop provided in the embodiment of the present application. Fig. 16 is a flow chart of a method for controlling a virtual prop provided in an embodiment of the present application, and referring to fig. 16, the method for controlling a virtual prop provided in an embodiment of the present application includes:
Step 1601: and (5) equipment the target virtual prop.
Here, the target virtual prop is a shotgun.
Step 1602: judging whether a triggering operation for the firing key is received, if so, executing step 1603; otherwise, go back to step 1601.
Here, the shotgun differs from other weapons in that the other weapon fires one virtual bullet per firing key, and the shotgun fires N virtual bullets per firing key.
In actual practice, for each virtual bullet, the corresponding firing coefficient is calculated by steps 1604 to 1610 described below.
Step 1603: the control target virtual prop fires a target number of virtual bullets.
Step 1604: judging whether the bullet belongs to a first virtual bullet set, if so, executing step 1605; otherwise, step 1606 is performed.
Here, the number of virtual bullets in the first virtual bullet set is preconfigured by the plan.
Step 1605: and obtaining a random value in the bottom-protecting circular area, and taking the random value as a random coefficient of the virtual bullet.
In actual implementation, the random value (coordinate value of random point) in the under-guard circular area is determined by m_shotsread=random.
Step 1606: judging whether the virtual bullet is the first bullet in the second virtual bullet set, if so, executing step 1607; otherwise, step 1609 is performed.
Step 1607: an angle interval is randomly acquired.
In practical implementation, first, a random starting angle is obtained by the following algorithm:
StartAngle=Random.Range(0,360),
wherein StartAngle represents a random starting angle, range (0, 360) represents an angle range from 0 to 360 degrees, and an angle value is randomly generated.
Then, the initial angle and the configured range are superimposed to obtain an angle interval, for example, the initial angle is 70, the configured range is (0, 20), and then the angle interval is (70, 90).
Step 1608: a random angle is obtained from the angle interval, and a random radius is obtained from the inner radius to the outer radius of the annular region.
In actual implementation, a random value is obtained from the angle interval and used as a random angle; meanwhile, a random value is obtained from the range of values from the inner radius to the outer radius and is taken as the random radius.
Here, the random angle of the first virtual bullet can be determined by the following algorithm:
angle=Random.Range(0,m_AngleUncertainty)+StartAngle,
where (0, m_angle noncerty) represents the range of configuration; random (0, m_angle Uncertainetry) represents randomly generating an angle value from the configured range; startAngle represents the starting angle.
Step 1609: an initial random angle is obtained from the angle interval, the initial random angle is overlapped with the equal interval to obtain a random angle, and a random radius is obtained from the inner radius to the outer radius of the annular area.
Here, the equal division intervals are determined according to the number of annular region divisions, for example, the annular region is divided into six equal divisions, each equal division interval is 60 degrees, assuming that the current virtual bullet is the second bullet in the second virtual bullet set, the angle interval is (70, 90), the initial random angle obtained from the angle interval is 78 degrees, and then the random angle is 78+60=138; the current virtual bullet is the third bullet in the second virtual bullet set, the angle interval is (70, 90), the initial random angle obtained from the angle interval is 80 degrees, then the random angle is 80+120=200.
Step 1610: and determining the emission coefficient of the virtual bullet according to the random angle and the random radius.
In actual implementation, the firing coefficient of the virtual bullet can be calculated by the following formula:
float rad=angle*(Mathf.PI*2/360);
float x=r*Mathf.Cos(rad);
float y=r*Mathf.Sin(rad);
m_shotSpread=new Vector2(x,y);
where rad denotes the stacking angle, r denotes the random radius, and m_shotsread denotes the emission coefficient.
Step 1611: the target number of virtual bullets is fired based on the random coefficients of the virtual bullets.
In practice, the firing direction of the virtual bullet can be determined by superimposing the firing coefficients in the direction indicated by the muzzle so that the virtual bullet is ejected from the position of the muzzle in the firing direction.
For example, referring to fig. 6, if the virtual bullet is not fired, the virtual bullet is fired in the direction indicated by arrow 601, which is the direction indicated by the muzzle; after the firing coefficient is superimposed in the direction indicated by the muzzle, the direction indicated by arrow 602 is obtained.
Step 1612: the bullet holes of the virtual bullets are presented through the bullet hole special effects corresponding to the material of the obstacle shot by the virtual bullets.
In practical implementation, after determining the firing direction of each virtual bullet, a ray is shot with the position of the muzzle as the starting point, and the direction of the ray is the determined firing direction of the virtual bullet, and after detecting the physical collision box, the material of the physical collision box is determined, and the bullet hole special effect corresponding to the material is determined, so that the bullet hole of the corresponding virtual bullet is presented through the determined bullet hole special effect.
For example, referring to fig. 10, each obstacle may have a different material hanging on it to collide with the box, and different bullet hole effects may be generated according to the different materials, and the bullet holes shown in fig. 10 correspond to the stone materials.
Referring to fig. 11, embodiments of the present application provide a number of different materials, including grass, ice, cloth, water, etc., where stone materials are selected.
Step 1613: judging whether the bullet hole display time is over, if so, executing step 1614; otherwise, return to step 1612.
Step 1614: the bullet holes presenting the virtual bullets are eliminated.
Here, the bullet hole automatically disappears after a certain period of time.
17A-17D are schematic views showing bullet hole presentation provided by the embodiment of the application, referring to FIG. 17A, when the radius of the bottom-protecting round area is small, the radius change is quick or the number of virtual bullets in the first virtual bullet set is large, the trajectory is stable, and the center is always accurate; referring to fig. 17B, when the bottom protection circular area is small, the annular area is small, the angle uncertainty of the outer ring is small, and the trajectory is extremely stable; referring to fig. 17C, when the round area of the bottom is large, the radius change is slow or the number of virtual bullets in the first virtual bullet set is small, the trajectory is stable, and the continuous shooting becomes random quickly; referring to fig. 17D, when the bottom-protecting circular area is small, the radius change is slow or the number of virtual bullets in the first virtual bullet set is medium, 4 consecutive shots are relatively aligned, and subsequently become random.
The embodiment of the application has the following beneficial effects:
On the basis of guaranteeing the randomness of the emission coefficient, the injury of the shotgun is expected to be more stable.
Continuing with the description below of an exemplary architecture implemented as a software module for virtual prop control device 455 provided in embodiments of the present application, in some embodiments, as shown in fig. 4, the software modules stored in virtual prop control device 455 of memory 450 may include:
the first presenting module 4551 is configured to present, in a picture of the virtual scene, an operation control of the target virtual prop; the target virtual prop is used for shooting a target object;
the control module 4552 is configured to control the target virtual prop to launch a target number of virtual bullets in response to a trigger instruction for the operation control, where the target number of virtual bullets is composed of a first virtual bullet set and at least one second virtual bullet set;
a second presenting module 4553 for presenting a process of shooting the target object by the virtual bullets of the target number;
when the target number of virtual bullets is shot to the target object, the virtual bullets in the first virtual bullet set are in a circular area, and the virtual bullets in the second virtual bullet set are in a circular area at the periphery of the circular area.
In some embodiments, the second presentation module 4553 is further configured to obtain a location of an aiming point for the target virtual prop to shoot the target object;
the position of the aiming point is used as a circle center, and the circular area and the annular area are determined on a plane where the target object is located;
presenting the bullet holes of the virtual bullets in the first virtual bullet set in the circular area, and
the bullet holes of the virtual bullets in the second virtual bullet set are presented in the annular region.
In some embodiments, the annular region comprises at least two sub-regions uniformly distributed in the annular region, and the sum of the areas of the at least two sub-regions is less than the area of the annular region;
the second presenting module 4553 is further configured to present, in at least two sub-areas of the annular area, the bullet holes of the virtual bullets in the second virtual bullet set, so that the virtual bullets in the second virtual bullet set are uniformly distributed in the at least two sub-areas.
In some embodiments, the second presenting module 4553 is further configured to present, when the number of the second virtual bullet sets is two or more, the bullet holes of the virtual bullets in the corresponding second virtual bullet sets in the annular area corresponding to each second virtual bullet set;
Wherein two or more annular regions corresponding to the two or more second virtual bullet sets are concentric rings, and the inner diameter of a first ring between two adjacent concentric rings is equal to the outer diameter of a second ring.
In some embodiments, the second rendering module 4553 is further configured to obtain a material corresponding to the target object in the virtual scene;
and displaying the bullet holes corresponding to the virtual bullets in the surface area of the target object through the bullet hole special effect corresponding to the material.
In some embodiments, the second presenting module 4553 is further configured to present, in a surface area of the target object, a bullet hole corresponding to each virtual bullet;
and when the presentation duration of the corresponding bullet hole of the virtual bullet arrives, canceling the bullet hole of each virtual bullet to be presented.
In some embodiments, the second presenting module 4553 is further configured to obtain a firing coefficient of each virtual bullet according to a virtual bullet set to which each virtual bullet belongs, respectively;
determining shooting directions of the virtual bullets according to the shooting coefficients of the virtual bullets respectively;
and presenting the virtual bullets of the target quantity, and shooting the target object along the corresponding shooting direction from the position of the target virtual bullets.
In some embodiments, the second presenting module 4553 is further configured to obtain a first emission coefficient range corresponding to the first virtual bullet set and a second emission coefficient range corresponding to the second virtual bullet set when the number of the second virtual bullet sets is one;
determining the emission coefficient of each virtual bullet in the first virtual bullet set according to the first emission coefficient range, and
and determining the emission coefficient of each virtual bullet in the second virtual bullet set according to the second emission coefficient range.
In some embodiments, the second presenting module 4553 is further configured to obtain a first number of virtual bullets in the first virtual bullet set;
when the emission coefficient is represented by the coordinate values which are offset relative to the circle center in the circular area, selecting a first number of coordinate values based on the range of the emission coefficient, and
and taking the selected coordinate values as the emission coefficients of the virtual bullets in the first virtual bullet set.
In some embodiments, the second presenting module 4553 is further configured to obtain a second number of virtual bullets in the first virtual bullet set;
when the emission coefficient is represented by the divergence angle generated by comparing the straight line from the target virtual prop to the center of the circular area, selecting a second number of values of the divergence angle based on the emission coefficient range, and
And taking the selected value of each divergence angle as the emission coefficient of each virtual bullet in the first virtual bullet set.
In some embodiments, the second presenting module 4553 is further configured to, for the second virtual bullet set, obtain, according to an inner radius and an outer radius of the annular region, a random radius of each virtual bullet in the second virtual bullet set, so that the random radius is in a range from the inner radius to the outer radius;
sequentially acquiring random angles of all virtual bullets in the second virtual bullet set;
and determining the emission coefficient of each virtual bullet in the second virtual bullet set according to the random radius and the random angle.
In some embodiments, the second presentation module 4553 is further configured to obtain a location of an aiming point for the target virtual prop to shoot the target object, and a location of the target virtual prop;
acquiring shooting positions of the virtual bullets according to the positions of the aiming points and the shooting coefficients of the virtual bullets;
and respectively determining the direction from the position of the target virtual prop to the shooting position of each virtual bullet as the shooting direction of each virtual bullet.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the control method of the virtual prop according to the embodiment of the application.
The present embodiments provide a computer readable storage medium having stored therein executable instructions that, when executed by a processor, cause the processor to perform a method provided by the embodiments of the present application, for example, as shown in fig. 5.
In some embodiments, the computer readable storage medium may be FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; but may be a variety of devices including one or any combination of the above memories.
In some embodiments, the executable instructions may be in the form of programs, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and they may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
As an example, the executable instructions may, but need not, correspond to files in a file system, may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a hypertext markup language (HTML, hyper Text Markup Language) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
As an example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices located at one site or, alternatively, distributed across multiple sites and interconnected by a communication network.
The foregoing is merely exemplary embodiments of the present application and is not intended to limit the scope of the present application. Any modifications, equivalent substitutions, improvements, etc. that are within the spirit and scope of the present application are intended to be included within the scope of the present application.

Claims (15)

1. A method for controlling a virtual prop, the method comprising:
in the picture of the virtual scene, presenting an operation control of the target virtual prop; the target virtual prop is used for shooting a target object;
Controlling the target virtual prop to emit a target number of virtual bullets in response to a trigger instruction aiming at the operation control, wherein the target number of virtual bullets is composed of a first virtual bullet set and at least one second virtual bullet set;
a process of shooting the target object by a virtual bullet presenting the target number;
when the target number of virtual bullets is shot to the target object, the virtual bullets in the first virtual bullet set are in a circular area, and the virtual bullets in the second virtual bullet set are in a circular area at the periphery of the circular area.
2. The method of claim 1, wherein the method further comprises:
acquiring the position of an aiming point for shooting the target object by the target virtual prop;
the position of the aiming point is used as a circle center, and the circular area and the circular ring area are determined on a plane where the target object is located;
presenting the bullet holes of the virtual bullets in the first virtual bullet set in the circular area, and
and presenting the bullet holes of the virtual bullets in the second virtual bullet set in the circular ring area.
3. The method of claim 2, wherein the annular region comprises at least two sub-regions uniformly distributed in the annular region, and a sum of areas of the at least two sub-regions is smaller than an area of the annular region;
The presenting the bullet holes of the virtual bullets in the second virtual bullet set in the circular ring area comprises the following steps:
in at least two sub-areas of the annular area, the holes of the virtual bullets in the second virtual bullet set are presented so that the virtual bullets in the second virtual bullet set are evenly distributed in the at least two sub-areas.
4. The method of claim 2, wherein the second set of virtual bullets has a one-to-one correspondence with the annular region; the presenting the bullet holes of the virtual bullets in the second virtual bullet set in the circular ring area comprises the following steps:
when the number of the second virtual bullet sets is two or more, respectively presenting bullet holes of virtual bullets in the corresponding second virtual bullet sets in the circular ring area corresponding to each second virtual bullet set;
wherein two or more annular regions corresponding to the two or more second virtual bullet sets are concentric rings, and the inner diameter of a first ring between two adjacent concentric rings is equal to the outer diameter of a second ring.
5. The method of claim 1, wherein the method further comprises:
Acquiring a material corresponding to the target object in the virtual scene;
and displaying the bullet holes corresponding to the virtual bullets in the surface area of the target object through the bullet hole special effect corresponding to the material.
6. The method of claim 1, wherein the method further comprises:
presenting bullet holes corresponding to each virtual bullet on the surface area of the target object;
and when the presentation duration of the corresponding bullet hole of the virtual bullet arrives, canceling the bullet hole of each virtual bullet to be presented.
7. The method of claim 1, wherein the process of presenting the target number of virtual bullets to fire the target object comprises:
respectively acquiring the emission coefficient of each virtual bullet according to the virtual bullet set to which each virtual bullet belongs;
determining shooting directions of the virtual bullets according to the shooting coefficients of the virtual bullets respectively;
and presenting the virtual bullets of the target quantity, and shooting the target object along the corresponding shooting direction from the position of the target virtual bullets.
8. The method of claim 7, wherein the obtaining the emission coefficient of each virtual bullet according to the virtual bullet set to which each virtual bullet belongs, respectively, comprises:
When the number of the second virtual bullet sets is one, a first emission coefficient range corresponding to the first virtual bullet set and a second emission coefficient range corresponding to the second virtual bullet set are obtained;
determining the emission coefficient of each virtual bullet in the first virtual bullet set according to the first emission coefficient range, and
and determining the emission coefficient of each virtual bullet in the second virtual bullet set according to the second emission coefficient range.
9. The method of claim 8, wherein determining the firing coefficient for each virtual bullet in the first set of virtual bullets based on the first firing coefficient range comprises:
acquiring a first number of virtual bullets in a first virtual bullet set;
when the emission coefficient is represented by the coordinate values which are offset relative to the circle center in the circular area, selecting a first number of coordinate values based on the range of the emission coefficient, and
and taking the selected coordinate values as the emission coefficients of the virtual bullets in the first virtual bullet set.
10. The method of claim 8, wherein determining the firing coefficient for each virtual bullet in the first set of virtual bullets based on the first firing coefficient range comprises:
Acquiring a second number of virtual bullets in the first virtual bullet set;
when the emission coefficient is represented by the divergence angle generated by comparing the straight line from the target virtual prop to the center of the circular area, selecting a second number of values of the divergence angle based on the emission coefficient range, and
and taking the selected value of each divergence angle as the emission coefficient of each virtual bullet in the first virtual bullet set.
11. The method of claim 7, wherein the obtaining the emission coefficient of each virtual bullet according to the virtual bullet set to which each virtual bullet belongs, respectively, comprises:
for the second virtual bullet set, according to the inner radius and the outer radius of the circular ring area, acquiring the random radius of each virtual bullet in the second virtual bullet set so that the random radius is in the range from the inner radius to the outer radius;
sequentially acquiring random angles of all virtual bullets in the second virtual bullet set;
and determining the emission coefficient of each virtual bullet in the second virtual bullet set according to the random radius and the random angle.
12. The method of claim 7, wherein said determining the firing direction of each of said virtual bullets based on the firing coefficient of each of said virtual bullets comprises:
Acquiring the position of an aiming point for shooting the target object by the target virtual prop and the position of the target virtual prop;
acquiring shooting positions of the virtual bullets according to the positions of the aiming points and the shooting coefficients of the virtual bullets;
and respectively determining the direction from the position of the target virtual prop to the shooting position of each virtual bullet as the shooting direction of each virtual bullet.
13. A control device for a virtual prop, the device comprising:
the first presentation module is used for presenting the operation control of the target virtual prop in the picture of the virtual scene; the target virtual prop is used for shooting a target object;
the control module is used for responding to a trigger instruction aiming at the operation control and controlling the target virtual prop to launch virtual bullets with target quantity, and the virtual bullets with the target quantity are composed of a first virtual bullet set and at least one second virtual bullet set;
a second presenting module, configured to present a process of shooting the target object by the virtual bullets with the target number;
when the target number of virtual bullets is shot to the target object, the virtual bullets in the first virtual bullet set are in a circular area, and the virtual bullets in the second virtual bullet set are in a circular area at the periphery of the circular area.
14. An electronic device, comprising:
a memory for storing executable instructions;
a processor for implementing the method of controlling a virtual prop of any one of claims 1 to 12 when executing executable instructions stored in the memory.
15. A computer readable storage medium storing executable instructions for implementing the method of controlling a virtual prop of any of claims 1 to 12 when executed by a processor.
CN202111655994.7A 2020-08-27 2020-08-27 Virtual prop control method, device, equipment, storage medium and program product Active CN114225419B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111655994.7A CN114225419B (en) 2020-08-27 2020-08-27 Virtual prop control method, device, equipment, storage medium and program product

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010879804.9 2020-08-27
CN202111655994.7A CN114225419B (en) 2020-08-27 2020-08-27 Virtual prop control method, device, equipment, storage medium and program product

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202010879804.9 Division 2020-08-27 2020-08-27

Publications (2)

Publication Number Publication Date
CN114225419A CN114225419A (en) 2022-03-25
CN114225419B true CN114225419B (en) 2023-06-23

Family

ID=80774614

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111655994.7A Active CN114225419B (en) 2020-08-27 2020-08-27 Virtual prop control method, device, equipment, storage medium and program product

Country Status (1)

Country Link
CN (1) CN114225419B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007260346A (en) * 2006-03-30 2007-10-11 Konami Digital Entertainment:Kk Game device, vibration control method and program
CN110585716A (en) * 2019-09-20 2019-12-20 腾讯科技(深圳)有限公司 Virtual item control method, device, equipment and storage medium
CN111001159A (en) * 2019-12-06 2020-04-14 腾讯科技(深圳)有限公司 Virtual item control method, device, equipment and storage medium in virtual scene
CN111111171A (en) * 2019-12-17 2020-05-08 腾讯科技(深圳)有限公司 Operation control method, operation control device, storage medium, and electronic device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003334382A (en) * 2002-05-21 2003-11-25 Sega Corp Game apparatus, and apparatus and method for image processing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007260346A (en) * 2006-03-30 2007-10-11 Konami Digital Entertainment:Kk Game device, vibration control method and program
CN110585716A (en) * 2019-09-20 2019-12-20 腾讯科技(深圳)有限公司 Virtual item control method, device, equipment and storage medium
CN111001159A (en) * 2019-12-06 2020-04-14 腾讯科技(深圳)有限公司 Virtual item control method, device, equipment and storage medium in virtual scene
CN111111171A (en) * 2019-12-17 2020-05-08 腾讯科技(深圳)有限公司 Operation control method, operation control device, storage medium, and electronic device

Also Published As

Publication number Publication date
CN114225419A (en) 2022-03-25

Similar Documents

Publication Publication Date Title
US20230347254A1 (en) Method and apparatus for providing online shooting game
EP4000704A1 (en) Virtual object control method, device, terminal, and storage medium
WO2021143260A1 (en) Method and apparatus for using virtual props, computer device and storage medium
US20230068653A1 (en) Method and apparatus for controlling virtual object to use virtual prop, terminal, and medium
US20220226727A1 (en) Method and apparatus for displaying virtual item, device, and storage medium
JP2022539289A (en) VIRTUAL OBJECT AIMING METHOD, APPARATUS AND PROGRAM
US20230013014A1 (en) Method and apparatus for using virtual throwing prop, terminal, and storage medium
CN110841290A (en) Processing method and device of virtual prop, storage medium and electronic device
CN110585716A (en) Virtual item control method, device, equipment and storage medium
US20220161138A1 (en) Method and apparatus for using virtual prop, device, and storage medium
CN111202979B (en) Virtual item control method and device, electronic equipment and storage medium
CN111921198B (en) Control method, device and equipment of virtual prop and computer readable storage medium
WO2022227958A1 (en) Virtual carrier display method and apparatus, device, and storage medium
CN110523080A (en) Shooting display methods, device, equipment and storage medium based on virtual environment
WO2023142617A1 (en) Virtual environment-based ray display method and apparatus, device, and storage medium
US20220379209A1 (en) Virtual resource display method and related apparatus
CN111202983A (en) Method, device, equipment and storage medium for using props in virtual environment
CN113457151B (en) Virtual prop control method, device, equipment and computer readable storage medium
CN114225419B (en) Virtual prop control method, device, equipment, storage medium and program product
CN113599822B (en) Virtual prop control method and device, storage medium and electronic equipment
JP2024500277A (en) Aiming mark display method, device, device and computer program
CN111450532B (en) Control method, device, terminal and storage medium for tracking property
CN114247140A (en) Information display method, device, equipment and medium
CN112121433A (en) Method, device and equipment for processing virtual prop and computer readable storage medium
CN113663329B (en) Shooting control method and device for virtual character, electronic equipment and storage medium

Legal Events

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