CN117270685A - Virtual prop control method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN117270685A
CN117270685A CN202311212087.4A CN202311212087A CN117270685A CN 117270685 A CN117270685 A CN 117270685A CN 202311212087 A CN202311212087 A CN 202311212087A CN 117270685 A CN117270685 A CN 117270685A
Authority
CN
China
Prior art keywords
virtual
virtual prop
aiming
prop
shooting
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.)
Pending
Application number
CN202311212087.4A
Other languages
Chinese (zh)
Inventor
张海渝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202311212087.4A priority Critical patent/CN117270685A/en
Publication of CN117270685A publication Critical patent/CN117270685A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/011Arrangements for interaction with the human body, e.g. for user immersion in virtual reality
    • 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/25Output arrangements for video game devices
    • A63F13/28Output arrangements for video game devices responding to control signals received from the game device for affecting ambient conditions, e.g. for vibrating players' seats, activating scent dispensers or affecting temperature or light

Landscapes

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

Abstract

The disclosure provides a control method and device for virtual props, electronic equipment and storage media. In the embodiment of the disclosure, a virtual scene is displayed, wherein the virtual scene comprises a virtual object and a virtual prop for shooting the virtual object, and the virtual prop is provided with a holding point; acquiring control information aiming at the virtual prop, and judging whether the virtual prop meets preset adsorption conditions for shooting the virtual object or not based on the control information; under the condition that the virtual prop meets the preset adsorption condition, the virtual prop is controlled to rotate by taking the holding point as the center, so that aiming rays of the virtual prop aim at the virtual object, and therefore, a player can aim the aiming center of the virtual prop at the virtual object more easily, and the game difficulty is reduced.

Description

Virtual prop control method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of Extended Reality (XR) technology, and in particular, to a control method of a virtual prop, a control device of the virtual prop, an electronic device, and a computer-readable storage medium.
Background
The augmented Reality technology is to combine Reality with Virtual through a computer to create a Virtual environment capable of man-machine interaction, and is also a generic term for multiple technologies such as augmented Reality (Augmented Reality, AR), virtual Reality (VR) and Mixed Reality (AR), and by combining the augmented Reality technology with a game, a richer and immersive game experience can be provided for a player, so that the player can interact with the Virtual environment in a more intuitive and real manner, and the player experiences an immersive experience.
The camera assisted aiming offset technology is a shooting aiming technology commonly used in shooting games of a computer end and a mobile end, and adjusts a viewing angle of a player by adjusting an angle of a camera so that the player aims a virtual firearm aiming at a target, however, in an extended reality scene, taking a VR shooting game as an example, the player usually aims shooting based on a head display device and a physical control device, the camera assisted aiming offset technology is not suitable for the VR shooting game, so how to realize shooting aiming in the VR scene is also one of the problems which need to be focused in the field.
Disclosure of Invention
The embodiment of the disclosure provides at least a control method, a device, electronic equipment and a storage medium for virtual props, which can automatically aim at a virtual object, so that a player can aim at a target more easily, and the game experience is improved.
The embodiment of the disclosure provides a control method of a virtual prop, which comprises the following steps:
displaying a virtual scene, wherein the virtual scene comprises a virtual object and a virtual prop for shooting the virtual object, and the virtual prop is provided with a holding point;
acquiring control information aiming at the virtual prop, and judging whether the virtual prop meets preset adsorption conditions for shooting the virtual object or not based on the control information;
and under the condition that the virtual prop meets the preset adsorption condition, controlling the virtual prop to rotate by taking the holding point as the center so as to aim the aiming rays of the virtual prop at the virtual object, wherein the aiming rays are used for representing the aiming direction of the virtual prop.
In the embodiment of the disclosure, under the condition that the virtual prop meets the preset adsorption condition, the virtual prop is controlled to rotate with the holding point as the center, so that the aiming rays of the virtual prop aim at the virtual object, namely, the virtual prop can be automatically aimed at the virtual object by controlling the virtual prop to rotate with the holding point as the center, thus, a player can aim at the aiming point more easily, the game difficulty is reduced, the handiness of the game is increased, and the game experience is promoted.
In addition, through automatic aiming, the competition among players with different game levels can be balanced better, and the fairness of the game is realized.
In one possible implementation, the virtual object is provided with an aiming reference line; the controlling the virtual prop to rotate with the holding point as a center so as to aim the aiming rays of the virtual prop at the virtual object comprises:
and determining the rotation speed of the virtual prop based on the relative position relation between the aiming point corresponding to the aiming ray of the virtual prop and the aiming reference line, and controlling the virtual prop to rotate with the holding point as the center according to the rotation speed so as to enable the aiming point corresponding to the aiming ray of the virtual prop to be positioned on the aiming reference line of the virtual object.
In the embodiment of the disclosure, the rotation speed of the virtual prop is determined according to the relative position relation between the aiming point and the aiming reference line, so that the self-adaptive adjustment of the rotation speed can be realized, and the phenomenon that the rotation speed of the virtual prop is too high to influence the aiming precision is avoided. Furthermore, it should be appreciated that when a player aims, typically the closer the aiming point is to the virtual object, the smaller the amplitude of the moving aiming point, and thus, in the manner described above, the aiming process can also be made to be more closely adjacent to the actual aiming process.
In a possible implementation manner, the virtual object is provided with an adsorption frame, the adsorption frame refers to an aiming area of the virtual object, the control information comprises shooting state information of the virtual prop, and the shooting state information comprises an un-shooting state; the determining the rotation speed of the virtual prop based on the relative position relation between the aiming point corresponding to the aiming ray of the virtual prop and the aiming reference line comprises the following steps:
determining the rotation speed of the virtual prop based on the relative position relation between the aiming point corresponding to the aiming ray of the virtual prop and the aiming reference line and the relative position relation between the aiming reference line and the target frame of the adsorption frame; the target frame is a frame with the minimum distance from the aiming point in the adsorption frame.
In the embodiment of the disclosure, when the virtual prop is in the non-shooting state, the rotation speed of the virtual prop is determined according to the relative position relationship between the aiming point and the aiming reference line and the relative position relationship between the aiming reference line and the target frame, so that the adsorption process of the aiming point of the virtual prop can have different adsorption effects.
In one possible implementation, the virtual object is provided with an aiming reference line; the controlling the virtual prop to rotate with the holding point as a center comprises:
determining a target rotation mode of the virtual prop based on a relative position relation between an aiming point corresponding to the aiming ray of the virtual prop and the aiming reference line; the target rotation mode comprises a parallel rotation mode and/or a pitching rotation mode;
and controlling the virtual prop to rotate by taking the holding point as the center according to the target rotation mode.
In the embodiment of the disclosure, the target rotation mode of the virtual prop is determined according to the relative position relationship between the aiming point and the aiming reference line, thus being beneficial to improving the rotation accuracy, in addition, the embodiment provides different rotation modes, which can improve the rotation diversity,
in one possible implementation, the virtual object has an adsorption frame, and the adsorption frame refers to an aiming area of the virtual object; the judging whether the virtual prop meets the preset adsorption condition for shooting the virtual object based on the control information comprises the following steps:
judging whether the distance between the virtual prop and the virtual object is within a preset distance range or not and judging whether an aiming point corresponding to an aiming ray of the virtual prop is positioned in an adsorption frame of the virtual object or not;
If the distance between the virtual prop and the virtual object is within the preset distance range and the aiming point corresponding to the aiming ray of the virtual prop is positioned in the adsorption frame of the virtual object, determining that the virtual prop meets the preset adsorption condition.
In the embodiment of the disclosure, whether the virtual prop meets the preset adsorption condition is judged by judging whether the distance between the virtual prop and the virtual object is within the preset distance range and judging whether the aiming point is positioned in the adsorption frame, so that the judgment precision for judging the preset adsorption condition can be improved, and erroneous judgment can be avoided.
In a possible implementation manner, the control information further comprises shooting state information of the virtual prop, wherein the shooting state information comprises an un-shooting state; the determining that the virtual prop meets the preset adsorption condition includes:
and if the shooting state information of the virtual prop is the non-shooting state, determining that the virtual prop accords with the preset adsorption condition if the approach speed of the aiming point corresponding to the aiming ray of the virtual prop to the virtual object is smaller than a preset speed threshold value.
In the embodiment of the disclosure, if the approach speed of the aiming point to the virtual object is smaller than the preset speed threshold, it is indicated that the current virtual prop has a tendency of aiming at the virtual object and the aiming point is relatively close to the virtual object, at this time, it can be determined that the virtual prop meets the preset adsorption condition in the non-shooting state, so that the judgment precision in the non-shooting state is facilitated to be improved.
In an alternative embodiment, the control information further includes shooting status information of the virtual prop, the shooting status information including an in-shooting status; the determining that the virtual prop meets the preset adsorption condition includes:
and if the shooting state information indicates that the virtual prop is in the shooting state, determining that the virtual prop accords with the preset adsorption condition.
In the embodiment of the disclosure, if the virtual prop is in the shooting state, it can be determined that the virtual prop meets the preset adsorption condition, and the subsequent shooting adsorption step can be continuously performed in the shooting state, so that the hit rate of shooting can be improved.
In an alternative embodiment, the virtual ballast has a shooting adsorption cooling time; if the shooting state information indicates that the virtual prop is in the shooting state, determining that the virtual prop meets the preset adsorption condition includes:
If the virtual prop is not in the shooting adsorption cooling time and the shooting state information indicates that the virtual prop is in the shooting state, determining that the virtual prop meets the preset adsorption condition.
In the embodiment of the disclosure, by setting the shooting adsorption cooling time, the virtual prop can not always meet the preset adsorption condition, so that the playability and strategic performance of the game can be improved, and in addition, abuse of shooting adsorption can be avoided, namely, the virtual prop can be prevented from being abused by a player by the cooling time, so that the competitive performance and the challenging performance of the game are maintained.
In an optional implementation manner, the adsorption frame is obtained by scaling an original frame based on a scaling ratio, wherein the scaling ratio is positively correlated with the distance from the virtual prop to the virtual object; and/or, the scaling is positively correlated with the magnification of the sighting telescope of the virtual prop assembly.
In this disclosed embodiment, the absorption frame can carry out self-adaptation adjustment according to the distance between virtual stage property to the virtual object, also can carry out self-adaptation adjustment according to the multiplying power of the sighting telescope that virtual stage property assembled, for example, when the player used high multiplying power sighting telescope, the virtual object generally appeared littleer, aims the degree of difficulty great, through increasing the size of absorption frame, can help the player to aim at the target more easily accurately, improves the accuracy of shooting.
In an alternative embodiment, after the determining that the virtual prop meets the preset adsorption condition, the method further includes:
acquiring real pose information of entity control equipment corresponding to the virtual prop under a world coordinate system under the condition that the virtual prop does not meet the preset adsorption condition;
based on the real pose information of the entity control equipment, determining virtual pose information corresponding to the real pose information under a virtual world coordinate system, and controlling the virtual prop to recover to a pose state matched with the entity control equipment according to the virtual pose information.
In the embodiment of the disclosure, if the virtual prop does not meet the preset condition, for example, the aiming point of the virtual prop is moved away, the actual orientations of the virtual prop and the control equipment (such as the handle) of the player are offset, and the virtual pose information corresponding to the real pose information is determined by determining the real pose information of the entity control equipment, so that the virtual prop is controlled to be restored to the pose matched with the entity control equipment according to the virtual pose information, and thus, the continuous smooth experience between the virtual prop and the entity control equipment can be ensured, and the game experience of a user is improved.
The embodiment of the disclosure provides a control device for a virtual prop, which comprises:
the display module is used for displaying a virtual scene, wherein the virtual scene comprises a virtual object and a virtual prop used for shooting the virtual object, and the virtual prop is provided with a holding point;
the judging module is used for acquiring control information aiming at the virtual prop and judging whether the virtual prop meets preset adsorption conditions for shooting the virtual object or not based on the control information;
and the control module is used for controlling the virtual prop to rotate by taking the holding point as a center under the condition that the virtual prop meets the preset adsorption condition so as to aim the aiming rays of the virtual prop at the virtual object, wherein the aiming rays are used for representing the aiming direction of the virtual prop.
In one possible implementation, the virtual object is provided with an aiming reference line; the control module is specifically used for:
and determining the rotation speed of the virtual prop based on the relative position relation between the aiming point corresponding to the aiming ray of the virtual prop and the aiming reference line, and controlling the virtual prop to rotate with the holding point as the center according to the rotation speed so as to enable the aiming point corresponding to the aiming ray of the virtual prop to be positioned on the aiming reference line of the virtual object.
In a possible implementation manner, the virtual object is provided with an adsorption frame, the adsorption frame refers to an aiming area of the virtual object, the control information comprises shooting state information of the virtual prop, and the shooting state information comprises an un-shooting state; the control module is specifically used for:
determining the rotation speed of the virtual prop based on the relative position relation between the aiming point corresponding to the aiming ray of the virtual prop and the aiming reference line and the relative position relation between the aiming reference line and the target frame of the adsorption frame; the target frame is a frame with the minimum distance from the aiming point in the adsorption frame.
In one possible implementation, the virtual object is provided with an aiming reference line; the control module is specifically used for:
determining a target rotation mode of the virtual prop based on a relative position relation between an aiming point corresponding to the aiming ray of the virtual prop and the aiming reference line; the target rotation mode comprises a parallel rotation mode and/or a pitching rotation mode;
and controlling the virtual prop to rotate by taking the holding point as the center according to the target rotation mode.
In one possible implementation, the virtual object has an adsorption frame, and the adsorption frame refers to an aiming area of the virtual object; the judging module is specifically configured to:
judging whether the distance between the virtual prop and the virtual object is within a preset distance range or not and judging whether an aiming point corresponding to an aiming ray of the virtual prop is positioned in an adsorption frame of the virtual object or not;
if the distance between the virtual prop and the virtual object is within the preset distance range and the aiming point corresponding to the aiming ray of the virtual prop is positioned in the adsorption frame of the virtual object, determining that the virtual prop meets the preset adsorption condition.
In a possible implementation manner, the control information further comprises shooting state information of the virtual prop, wherein the shooting state information comprises an un-shooting state; the judging module is specifically configured to:
and if the shooting state information of the virtual prop is the non-shooting state, determining that the virtual prop accords with the preset adsorption condition if the approach speed of the aiming point corresponding to the aiming ray of the virtual prop to the virtual object is smaller than a preset speed threshold value.
In a possible embodiment, the control information further includes shooting status information of the virtual prop, the shooting status information including an in-shooting status; the judging module is specifically configured to:
and if the shooting state information indicates that the virtual prop is in the shooting state, determining that the virtual prop accords with the preset adsorption condition.
In one possible embodiment, the virtual ballast has a shooting adsorption cooling time; the judging module is specifically configured to:
if the virtual prop is not in the shooting adsorption cooling time and the shooting state information indicates that the virtual prop is in the shooting state, determining that the virtual prop meets the preset adsorption condition.
In a possible implementation manner, the absorption frame is obtained by scaling an original frame based on a scaling ratio, wherein the scaling ratio is positively correlated with the distance from the virtual prop to the virtual object; and/or, the scaling is positively correlated with the magnification of the sighting telescope of the virtual prop assembly.
In one possible implementation, the obtaining module is further configured to:
acquiring real pose information of entity control equipment corresponding to the virtual prop under a world coordinate system under the condition that the virtual prop does not meet the preset adsorption condition;
The control module is further configured to:
based on the real pose information of the entity control equipment, determining virtual pose information corresponding to the real pose information under a virtual world coordinate system, and controlling the virtual prop to recover to a pose state matched with the entity control equipment according to the virtual pose information.
The embodiment of the disclosure also provides an electronic device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory in communication via the bus when the electronic device is running, the machine-readable instructions when executed by the processor performing the steps of the method of controlling a virtual prop as described in any one of the possible embodiments above.
The disclosed embodiments also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of controlling a virtual prop described in any of the possible implementations above.
The foregoing objects, features and advantages of the disclosure will be more readily apparent from the following detailed description of the preferred embodiments taken in conjunction with the accompanying drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for the embodiments are briefly described below, which are incorporated in and constitute a part of the specification, these drawings showing embodiments consistent with the present disclosure and together with the description serve to illustrate the technical solutions of the present disclosure. It is to be understood that the following drawings illustrate only certain embodiments of the present disclosure and are therefore not to be considered limiting of its scope, for the person of ordinary skill in the art may admit to other equally relevant drawings without inventive effort.
FIG. 1 illustrates a flow chart of a method of controlling a virtual prop provided by some embodiments of the present disclosure;
FIG. 2 illustrates a schematic view of a grip point provided by some embodiments of the present disclosure;
FIG. 3 illustrates a schematic diagram of an adsorption frame provided by some embodiments of the present disclosure;
FIG. 4 illustrates a schematic view of an aiming reference line provided by some embodiments of the present disclosure;
FIG. 5 illustrates a schematic diagram of a control device for virtual props provided by some embodiments of the present disclosure;
fig. 6 illustrates a schematic diagram of an electronic device provided by some embodiments of the present disclosure.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are only some embodiments of the present disclosure, but not all embodiments. The components of the embodiments of the present disclosure, which are generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present disclosure provided in the accompanying drawings is not intended to limit the scope of the disclosure, as claimed, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be made by those skilled in the art based on the embodiments of this disclosure without making any inventive effort, are intended to be within the scope of this disclosure.
It will be appreciated that prior to using the technical solutions disclosed in the embodiments of the present disclosure, the user should be informed and authorized of the type, usage range, usage scenario, etc. of the personal information related to the present disclosure in an appropriate manner according to the relevant legal regulations.
For example, in response to receiving an active request from a user, a prompt is sent to the user to explicitly prompt the user that the operation it is requesting to perform will require personal information to be obtained and used with the user. Thus, the user can autonomously select whether to provide personal information to software or hardware such as an electronic device, an application program, a server or a storage medium for executing the operation of the technical scheme of the present disclosure according to the prompt information.
As an alternative but non-limiting implementation, in response to receiving an active request from a user, the manner in which the prompt information is sent to the user may be, for example, a popup, in which the prompt information may be presented in a text manner. In addition, a selection control for the user to select to provide personal information to the electronic device in a 'consent' or 'disagreement' manner can be carried in the popup window.
It will be appreciated that the above-described notification and user authorization process is merely illustrative and not limiting of the implementations of the present disclosure, and that other ways of satisfying relevant legal regulations may be applied to the implementations of the present disclosure.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
The term "and/or" is used herein to describe only one relationship, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist together, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
The camera assisted aiming offset technique is a common shooting aiming technique in shooting games at a computer end and a mobile end, and adjusts the view angle of a player by adjusting the angle of a camera so that the player aims a virtual firearm aiming at a target.
It is found that, in an extended reality scenario, taking a VR shooting game as an example, a player usually performs shooting aiming based on a head display device and a physical control device, and the above-mentioned camera assisted aiming offset technology is not suitable for the VR shooting game, so how to implement shooting aiming in the VR scenario is also one of the problems that need to be focused in the field.
Based on the above study, the present disclosure provides a control method, an apparatus, an electronic device, and a storage medium for a virtual prop, where the method first displays a virtual scene, where the virtual scene includes a virtual object and a virtual prop for shooting the virtual object, and the virtual prop is provided with a holding point; then, control information aiming at the virtual prop is obtained, and whether the virtual prop meets preset adsorption conditions for shooting the virtual object is judged based on the control information; and finally, under the condition that the virtual prop meets the preset adsorption condition, controlling the virtual prop to rotate by taking a holding point as a center so as to aim the aiming rays of the virtual prop at the virtual object, wherein the aiming rays are used for representing the aiming direction of the virtual prop.
In the embodiment of the disclosure, under the condition that the virtual prop meets the preset adsorption condition, the virtual prop is controlled to rotate by taking the holding point as the center, so that the aiming rays of the virtual prop aim at the virtual object, namely, can automatically aim at the virtual object, so that a player can aim at the aiming point more easily, the game difficulty is reduced, the handiness of the game is increased, and the game experience is improved.
In addition, through automatic aiming, the competition among players with different game levels can be balanced better, and the fairness of the game is realized.
For the convenience of understanding the present embodiment, first, an execution body of the method for controlling a virtual prop provided in the embodiment of the present disclosure will be described in detail. The execution main body of the control method of the virtual prop provided by the embodiment of the disclosure is electronic equipment. In this embodiment, the electronic device is a server, and the server may be an independent physical server, or may be a server cluster or a distributed system formed by a plurality of physical servers, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, cloud storage, big data, and an artificial intelligence platform. In other embodiments, the electronic device may also be a terminal device. The terminal device may be a mobile device, a user terminal, a handheld device, a computing device, a wearable device, or the like.
In other embodiments, the electronic device may also include an AR (Augmented Reality) device, a VR (Virtual Reality) device, an MR (Mixed Reality) device, or the like. For example, the AR device may be a mobile phone or a tablet computer with AR function, or may be AR glasses, which is not limited herein. In addition, the control method of the virtual prop can be realized by a mode that a processor calls computer readable instructions stored in a memory.
Here, first, terms of virtual reality technology according to embodiments of the present disclosure will be described accordingly.
Virtual scene: 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, the virtual scene may include a virtual sky scene, a virtual land scene, a virtual ocean scene, a virtual space scene, etc., the virtual sky scene may include virtual elements of virtual sun, virtual cloud, etc., the virtual land scene may include virtual environment elements of virtual desert, virtual city, etc., the virtual ocean scene may include virtual marine creatures (such as fish, conchioids), the virtual space scene may include elements of virtual furniture, virtual appliances, etc.
Virtual object: refers to objects in a virtual scene. The virtual 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 scene may include at least one virtual object, which may be a virtual avatar representing a player in the virtual scene, and in the virtual reality game, the player may control the virtual object to move, interact, fight, etc. in the virtual scene of the virtual reality game.
Alternatively, the virtual object may be a player character controlled by a VR control device (e.g., VR handle), an artificial intelligence (Artificial Intelligence, AI) in a virtual scene fight, or a non-player character (Non Player Character, NPC) set in a virtual scene interaction.
Taking a shooting virtual reality game 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, or the like on land, or may control a virtual object to swim, float, or dive in the ocean, or the like, and of course, the user may control a virtual object to move in the virtual scene while taking a virtual vehicle, for example, a virtual car, a virtual aircraft, a virtual yacht, or the like, or may control a virtual object to interact with other virtual objects in a combat manner or the like through the virtual object, for example, the virtual object may include a variety of throwing type virtual objects such as a hand mine, a cluster mine, a smoke bomb, a shock bomb, a burning flask, or the like, or may be a shooting type virtual object such as a gun, a pistol, a rifle, or the like.
The following describes in detail a control method of a virtual prop provided in an embodiment of the present application with reference to the accompanying drawings. Referring to fig. 1, a flowchart of a method for controlling a virtual prop according to an embodiment of the present disclosure is shown, where the method includes steps S101 to S103, where:
s101, displaying a virtual scene, wherein the virtual scene comprises a virtual object and a virtual prop used for shooting the virtual object, and the virtual prop is provided with a holding point.
Here, the virtual scene may refer to a virtual game scene of a virtual shooting game, the virtual shooting game may be a multiplayer online tactical game (Multiplayer Online Battle Arena, MOBA) or a single player game (SinglePlayer Game, SPG), the virtual object refers to an object to be shot, for example, may be artificial intelligence in the fight of the virtual scene, may also be a non-player character, and the number of the virtual objects may be one or a plurality.
In other embodiments, the virtual scene may further include a virtual object controlled by the player, which is not limited herein.
In the embodiment of the disclosure, the virtual prop refers to a shooting type virtual prop, for example, the virtual prop may be a virtual firearm (for example, a virtual pistol, a virtual rifle, a virtual sniper gun, a virtual submachine gun, etc.), a virtual bow or a virtual slingshot, wherein a player may control the virtual prop to perform actions such as gun setting, gun collecting, or shooting through an entity control device (for example, an entity handle). It should be appreciated that if the virtual prop is a virtual firearm, the virtual firearm may be fitted with a virtual magazine, sighting telescope (magnifier), muffler, muzzle, grip, stock, etc. accessory.
Optionally, when the virtual scene includes a virtual object controlled by a player, the virtual prop may be a prop held by the virtual object controlled by the player (the prop may be a prop allocated in advance for the virtual object corresponding to the player, or may be a prop picked up by the virtual object corresponding to the player in a virtual reality game, which is not limited herein).
The virtual prop is further provided with a holding point, where the holding point is a preset point, and for example, please refer to fig. 2, which is a schematic diagram of the holding point provided by some embodiments of the present disclosure. As shown in fig. 2, point 21 on virtual prop 20 is the gripping point of virtual prop 20. The function of the grip point 20 will be described in the subsequent steps.
It should be noted that the positions of the holding points of different virtual props may be different, and the holding points are virtual points, which are not displayed in the game screen.
In this embodiment, the virtual shooting game is a VR shooting game, and a player may control, through an entity control device, a virtual object in the game to perform operations such as shooting, and at the same time, the player wears a head display device, and observes a virtual game scene through the head display device.
S102, acquiring control information aiming at the virtual prop, and judging whether the virtual prop meets preset adsorption conditions for shooting the virtual object or not based on the control information.
Here, the control information of the virtual prop refers to virtual control information, which is obtained based on control information of the physical control device corresponding to the virtual prop, and here, the control information of the physical control device may be converted into virtual control information based on a conversion relationship between a preset virtual coordinate system and a world coordinate system.
The control information of the virtual prop may include pose information of the virtual prop (i.e., pose of the virtual prop in the virtual scene), and in some embodiments, the control information of the virtual prop may further include shooting state information of the virtual prop, where the shooting state information of the virtual prop may include an un-shot state and an in-shot state.
In the embodiment of the disclosure, corresponding adsorption conditions are set for shooting adsorption of the virtual prop, and the shooting adsorption of the virtual prop is triggered only when the adsorption conditions are met.
Specifically, when judging whether the virtual prop meets a preset adsorption condition for shooting the virtual object based on the control information, whether the distance between the virtual prop and the virtual object is within a preset distance range or not and whether an aiming point corresponding to an aiming ray of the virtual prop is located in an adsorption frame of the virtual object or not can be judged, and if the distance between the virtual prop and the virtual object is within the preset distance range and the aiming point corresponding to the aiming ray of the virtual prop is located in the adsorption frame of the virtual object, the virtual prop is determined to meet the preset adsorption condition.
The preset distance range may be preset according to actual requirements, for example, the preset distance range may be 10 meters to 200 meters.
Optionally, when the user (game developer) sets the preset distance range, the minimum preset distance and the maximum preset distance may be set, so that the preset distance range may be determined. In some embodiments, because the ranges of the different types of virtual props are different, different preset distance ranges may be set for the different types of virtual props, for example, a gun range is 100 meters, and a sniper gun range is 800 meters, and different preset distance ranges may be set for the different types of virtual props, for example, a preset distance range corresponding to a gun is 5-100 meters, and a preset distance range corresponding to a sniper gun is 50-700 meters.
The adsorption frame of the virtual object refers to an aiming area of the virtual object.
For an example, please refer to fig. 3, which is a schematic diagram of an adsorption frame provided in some embodiments of the present disclosure. As shown in fig. 3, the adsorption frame 32 of the virtual object 31 is constructed based on the character capsule 33 of the virtual object, and in this embodiment, a box may be constructed with the center point 331 of the character capsule 33 as the center, and the box is the adsorption frame 32.
Among them, a character Capsule (Capsule character) is a type of impactor assembly frequently used in game development for representing an impact volume of a character, which is generally used to represent characters having a cylindrical or Capsule shape, such as human characters and animal characters.
Further, it should be understood that since the size of the adsorption frame is related to the distance between the virtual prop and the virtual object and the magnification size of the scope, the size of the adsorption frame will be described in detail later.
In this embodiment, when determining whether the distance between the virtual prop and the virtual object is within the preset distance range, the pose of the virtual prop and the pose of the virtual object may be determined first, and then the distance between the virtual prop and the virtual object may be determined according to the pose of the virtual prop and the pose of the virtual object.
In other embodiments, the pose of the virtual object holding the virtual prop may also be determined, and then the distance between the virtual prop and the virtual object may be determined according to the pose of the virtual object holding the virtual prop and the pose of the virtual object. It can be appreciated that since the distance between the virtual prop and the virtual object holding the virtual prop is short, the difference between the distance determined based on the pose of the virtual prop and the distance determined based on the pose of the virtual object holding the virtual prop is small.
In this embodiment, in addition to determining a distance between a virtual prop and a virtual object, it is also required to determine whether an aiming point corresponding to an aiming ray of the virtual prop is located in an adsorption frame of the virtual object, where the aiming ray is used to characterize a direction in which the virtual prop is aimed.
For example, referring again to fig. 3, the intersection point of the aiming ray of the virtual prop and the plane of the absorption frame 32 is the aiming point 34, where the aiming point 34 may or may not be in the absorption frame 32.
In the embodiment of the disclosure, if the distance between the virtual prop and the virtual object is within the preset distance range and the aiming point corresponding to the aiming ray of the virtual prop is located in the adsorption frame of the virtual object, it is determined that the virtual prop meets the preset adsorption condition, and therefore accuracy of judging that the virtual prop meets the preset adsorption condition is facilitated to be improved.
In other embodiments, when it is determined that the virtual prop meets the preset adsorption condition, a corresponding determination is further required according to shooting status information of the virtual prop, and this will be described in detail in the following examples.
And S103, controlling the virtual prop to rotate by taking a holding point as a center under the condition that the virtual prop meets the preset adsorption condition so as to aim the aiming rays of the virtual prop at the virtual object.
It can be understood that if the virtual prop meets the preset adsorption condition, it is indicated that the aiming point of the current virtual prop is close to the virtual object, so that in order to improve the hit rate of the virtual prop, the virtual prop can be controlled to rotate with the holding point as the center so as to aim the aiming rays of the virtual prop at the virtual object, that is, the aiming point of the virtual prop can be automatically aimed at the virtual object, so that the player can aim the aiming point at the target more easily, the game difficulty is reduced, and the easy-to-go handedness of the game is increased, thereby improving the game experience.
In some embodiments, when the virtual prop is controlled to rotate around the holding point so as to aim the aiming ray of the virtual prop at the virtual object, the rotation speed of the virtual prop may be determined based on the relative positional relationship between the aiming point corresponding to the aiming ray of the virtual prop and the aiming reference line, and the virtual prop may be controlled to rotate around the holding point according to the rotation speed so as to locate the aiming point corresponding to the aiming ray of the virtual prop on the aiming reference line of the virtual object.
The aiming reference line refers to a reference line preset for a virtual object.
For example, referring to fig. 4, fig. 4 is a schematic diagram of an aiming reference line provided by some embodiments of the present disclosure, and as shown in fig. 4, a line segment 35 on a virtual object is the aiming reference line, where the shape of the aiming reference line may be set according to actual requirements, for example, the aiming reference line may be matched with the virtual object.
Since the shape and size of the different virtual objects are different, the shape and size of the sighting reference line of the different virtual objects may also be different.
It should be appreciated that after the preset adsorption condition is met, the virtual prop may be rotated towards the aiming reference line of the virtual object at a certain speed, so that the virtual prop can hit the virtual object, where the speed of the virtual prop may be fixed or variable.
Alternatively, the rotation speed of the virtual prop may be determined according to a relative positional relationship between an aiming point corresponding to an aiming ray of the virtual prop and an aiming reference line. Specifically, a correspondence between the distance and the speed may be preconfigured, and then, a distance between the aiming point and the aiming reference line is determined according to a relative positional relationship between the aiming point and the aiming reference line, so that a rotation speed of the virtual prop is determined based on the correspondence between the distance and the speed and the distance between the aiming point and the aiming reference line.
For example, the correspondence between the distance and the speed may be that the smaller the distance is, the smaller the speed is, so that the process of aiming the adsorption is closer to the actual situation.
In some embodiments, when the shooting state information of the virtual prop indicates that the virtual prop is in a shooting state, the virtual prop may be controlled to rotate at the rotation speed with the holding point as a center in a shooting interval time of the virtual prop.
Here, because the virtual prop can receive the influence of recoil in the in-process of continuously shooting, if adsorb continuously, can have the conflict with firearm recoil, consequently, in order to guarantee can not adsorb at the in-process of lifting up of firearm recoil, only can control virtual prop rotation in shooting interval time.
In other embodiments, in a case where the shooting state information of the virtual prop indicates that the virtual prop is in an unfired state, the rotation speed of the virtual prop may be determined based on a relative positional relationship between an aiming point corresponding to an aiming ray of the virtual prop and the aiming reference line, and a relative positional relationship between the aiming reference line and a target rim of the suction frame.
The target frame is a frame with the minimum distance from the aiming point in the adsorption frame.
For example, referring to fig. 4 again, the adsorbing frame 32 includes a first frame 321, a second frame 322, a third frame 323, and a fourth frame 324, wherein the fourth frame 324 is the target frame if the aiming point 34 is closest to the fourth frame 324.
It will be appreciated that as the position of the aiming point 34 changes, the target frame may also change.
Here, a first distance between an aiming point and an aiming reference line may be determined based on a relative positional relationship between the aiming point corresponding to an aiming ray of the virtual prop and the aiming reference line, and a second distance between the aiming reference line and a target frame of the suction frame may be determined based on the aiming reference line and the target frame of the suction frame, and then a distance ratio between the first distance and the second distance may be determined, so that a rotation speed corresponding to the distance ratio may be determined based on a correspondence between a preset distance ratio and a rotation speed and a distance ratio between the first distance and the second distance.
The corresponding relation between the preset distance ratio and the rotation speed can be set according to actual requirements, for example, the distance ratio and the rotation speed can be positively correlated.
In other embodiments, when the virtual prop is controlled to rotate around the holding point, a target rotation mode of the virtual prop may be determined based on a relative positional relationship between an aiming point corresponding to an aiming ray of the virtual prop and the aiming reference line; the target rotation mode comprises a parallel rotation mode and/or a pitching rotation mode; and then, according to the target rotation mode, controlling the virtual prop to rotate by taking the holding point as the center.
Here, the parallel rotation method may be a method in which the virtual prop rotates to both sides (rotates to the left or rotates to the right), and the pitch rotation method may be a method in which the virtual prop rotates up and down.
Taking the visual angle of the virtual prop as an example, if the aiming point is positioned at the left side of the aiming reference line, determining that the target rotation mode of the virtual prop is right parallel rotation; if the aiming point is positioned on the right side of the aiming reference line, determining that the target rotation mode of the virtual prop is left parallel rotation; if the aiming point is positioned at the lower side of the aiming reference line, determining that the target rotation mode of the virtual prop is upward rotation; if the aiming point is positioned on the upper side of the aiming reference line, determining that the target rotation mode of the virtual prop is downward rotation; if the aiming point is located at the lower right, upper right, lower left, upper left, etc. of the aiming reference line, the parallel rotation mode and the pitch rotation mode may be combined, which is not limited herein. In this embodiment, the virtual prop is rotated onto the aiming reference line by different rotation modes, so that the diversity of rotation modes can be improved.
In the embodiment of the disclosure, shooting adsorption is performed in a shooting state, because at a moment of shooting, a player can see recoil performance of a virtual prop, shooting animation of the virtual prop and the like in a picture, so that the shooting adsorption is high in concealment and high in effectiveness.
In some embodiments, during game development, a "first shot instant adsorption" switch may be set, and the user may set whether to turn on the switch for the virtual prop, thus ensuring that the first shot must hit. And because the virtual props are not all the same as the sniping gun have the characteristic of killing once, the first shooting instant adsorption switch can be respectively arranged for different virtual props and can be respectively configured, so that the shooting difference among different virtual props can be improved, and the game has more realism.
The following describes the adsorption frame in detail. In some embodiments, the size and the center point of the adsorption frame may be set according to the state of the virtual object, where the state of the virtual object may include a standing state, a squatting state, and a lying state, where the standing state and the squatting state are taken as examples, it should be understood that in the standing state, the adsorption frame is larger if the impact area of the virtual object is larger, and in the squatting state, the adsorption frame is also required to be relatively smaller if the impact area of the virtual object is smaller.
In other embodiments, the size of the adsorption frame may be further obtained by scaling the original frame based on a scaling ratio, where the scaling ratio is positively related to a distance from the virtual prop to the virtual object; and/or, the scaling is positively correlated with the magnification of the sighting telescope of the virtual prop assembly.
That is, the user (game developer) may configure the adsorption frame of each virtual object in advance, specifically, may set a correspondence between the distance and the scaling for each virtual object in advance, so after determining the distance between the virtual prop and the virtual object, the scaling may be determined based on the distance between the virtual prop and the virtual object and the correspondence between the distance and the scaling, and the adsorption frame of the virtual object may be scaled according to the scaling. Optionally, the correspondence between the distance and the scaling may be the same or different for different virtual objects, which is not limited herein.
Similarly, the virtual prop can be further provided with a sighting telescope, and because the multiplying power of the sighting telescope is different, the sizes of the adsorption frames observed by the players are also different, in this embodiment, the corresponding relation between the multiplying power and the scaling ratio can be preset, so that in the open state, the scaling ratio can be determined according to the current multiplying power of the sighting telescope and the corresponding relation between the multiplying power and the scaling ratio, and scaling processing can be performed on the adsorption frames of the virtual object according to the scaling ratio.
It should be understood that in the case where the virtual prop is equipped with the scope and the scope is in the open state, the size of the suction frame is related to both the distance between the virtual prop and the virtual object and the magnification of the scope, and thus, it is necessary to adjust the size of the suction frame based on the distance between the virtual prop and the virtual object and the magnification of the scope at the same time.
In this disclosed embodiment, through carrying out corresponding adjustment to the adsorption frame, can help the player to aim at the target more easily accurately, for example, when the player uses high magnification doubly mirror, the target usually looks smaller, aims the degree of difficulty great, can increase the size of adsorption frame this moment to can improve the accuracy of shooting. In addition, as each multiplying power has the application under the specific situation, the game performance among different multiplying powers can be balanced and the game balance performance can be improved by adjusting the size of the adsorption frame through the multiplying power.
In the foregoing embodiments, when it is determined that the virtual prop meets the preset adsorption condition, a corresponding determination is further required according to shooting status information of the virtual prop, which is described in detail below.
In the foregoing, the shooting state information of the virtual prop has been described as including an unfired state and an in-shooting state, and thus, in this embodiment, different judging manners are provided for the two states, respectively.
First, a mode of determining that the shooting status information is in the non-shooting status will be described.
And if the shooting state information of the virtual prop is the non-shooting state, determining that the virtual prop accords with the preset adsorption condition if the approach speed of the aiming point corresponding to the aiming ray of the virtual prop to the virtual object is smaller than a preset speed threshold value.
The preset speed threshold may be set according to actual requirements, and is not limited herein, and may be, for example, 2 degrees per second, 3 degrees per second, or the like.
It should be appreciated that, because the position of the aiming point corresponding to the aiming ray of the virtual prop is controlled by the player, when the approaching speed of the aiming point to the virtual object is less than the preset speed threshold, the player is indicated to have a trend of controlling the virtual prop to aim at the virtual object, therefore, the judgment can be made based on the preset speed threshold, if the approaching speed of the aiming point to the virtual object is less than the preset speed threshold, the aiming point is indicated to be approaching to the virtual object, and the virtual prop can be determined to meet the preset adsorption condition.
Specifically, since the virtual prop is provided with the aiming ray, a target reference point closest to the aiming point can be determined on the aiming reference line, and a reference ray is emitted to the target reference point based on the holding point, it is understood that an included angle exists between the aiming ray and the reference ray, when the player controls the aiming of the virtual prop, the aiming point gradually approaches the target reference point, the included angle between the aiming ray and the reference ray is reduced, at this time, the reduction speed of the included angle can be determined, and under the condition that the reduction speed of the included angle reaches the preset speed threshold, the virtual prop can be determined to meet the preset adsorption condition, so that the accuracy of determining that the virtual prop meets the preset adsorption condition can be improved by judging whether the approach speed of the aiming point to the virtual object is smaller than the preset speed threshold.
Next, a detailed description will be given of a mode of determining that the shooting status information is in the shooting status.
In some embodiments, if the shooting status information indicates that the virtual prop is in the shooting status, determining that the virtual prop meets the preset adsorption condition.
Here, it is understood that as long as the virtual prop is in the shooting state, it is determined that the virtual prop meets the preset condition, so that in the shooting state, the virtual prop is controlled to perform subsequent continuous rotation (i.e., to continuously adsorb the aiming point onto the aiming reference line).
In other embodiments, a shooting adsorption cooling time may be set for the virtual prop, so that if the virtual prop is not within the shooting adsorption cooling time and the shooting state information indicates that the virtual prop is in the shooting state, it is determined that the virtual prop meets the preset adsorption condition.
Where Cool Down Time (CD) refers to the Time between the release of a skill (or use of an item) to the next Time such skill (or use of the item) can be used. Here, the shooting adsorption cooling time refers to an interval time from the end of the last shooting adsorption to the next shooting adsorption.
The shooting adsorption cooling time can be set according to actual requirements, for example, 5 seconds and 10 seconds, and the shooting adsorption cooling time of different virtual props can also be different, for example, the shooting adsorption cooling time of a pistol is 5 seconds, and the shooting adsorption cooling time of a rifle is 2 seconds.
For example, if the shooting adsorption cooling time of the virtual prop is 5 seconds and the time from the last shooting end of the current virtual prop is 6 seconds, which indicates that the virtual prop is not currently in the shooting adsorption cooling time and the virtual prop is in a shooting state, it is determined that the virtual prop meets the preset adsorption condition. If the virtual prop is currently in the shooting adsorption cooling time, even if the virtual prop is in a shooting state, the virtual prop does not meet the preset adsorption condition, so that the playability of the virtual prop is higher.
Optionally, if the virtual prop is in the process of continuous shooting and the virtual prop is not in the shooting adsorption cooling time, the virtual prop can be determined to meet the preset adsorption condition in the process of continuous shooting, and the subsequent adsorption step can be performed.
Alternatively, the maximum number of bullets allowed by shooting adsorption (or the maximum number of continuous shots) may be set, and after the number of continuous shots reaches the maximum number of continuous shots, it is determined that the virtual prop does not meet the preset adsorption condition.
Here, like the actual shooting game scene, if continuous shooting is affected by shake and recoil generated by continuous shooting, resulting in a decrease in accuracy of aiming, so that in order to make shooting adsorption of the virtual prop more realistic, after the number of continuous shooting reaches the maximum number of continuous shooting, it is determined that the virtual prop does not meet the preset adsorption condition, and the step of subsequent shooting adsorption is not performed.
It should be understood that after determining that the virtual prop meets the preset adsorption condition, if the virtual prop does not meet the preset adsorption condition, the pose of the virtual prop needs to be recovered, specifically, the real pose information of the entity control device corresponding to the virtual prop under the world coordinate system may be obtained under the condition that the virtual prop does not meet the preset adsorption condition, then the virtual pose information of the virtual prop under the virtual world coordinate system is determined based on the real pose information of the entity control device, and the virtual prop is controlled to be recovered to the pose state matched with the entity control device according to the virtual pose information.
The virtual prop failing to satisfy the preset adsorption condition may mean that a distance between the virtual prop and the virtual object is not within a preset distance range, or that an aiming point corresponding to an aiming ray of the virtual prop is not within an adsorption frame, or that a shielding object exists between the virtual prop and the virtual object, and the like, which is not limited herein.
Here, the blocking object may be other virtual objects in the virtual shooting game scene, for example, may be a virtual building, a smoke bomb, a flash bomb, or may be a virtual object controlled by other players, which is not limited herein.
Optionally, it may be determined by ray detection whether an occlusion object exists between the virtual prop and the virtual object.
The physical control device may be a physical handle or the like, and is not limited herein.
It should be understood that after the virtual prop rotates, the virtual prop may deviate from the actual direction of the entity control device, so that the real pose information of the entity control device may be obtained, and the virtual pose information corresponding to the real pose information under the virtual world coordinate system may be determined based on the real pose information of the entity control device, so that the virtual prop may be controlled to recover from the current pose to the pose state matched with the entity control device according to the virtual pose information, so that the pose between the virtual prop and the entity control device may be matched, and the game experience of the player may be more fit and actual.
In some embodiments, when the virtual prop is controlled to recover from the current pose to a pose state that matches the physical control device, a Lerp (linear interpolation) approach may be employed to make the animation or pose change appear smoother and more natural. Where "Interpolation" is a technique for smoothing intermediate states between two or more values of transitions or Interpolation.
The foregoing embodiments describe how to determine that the preset adsorption condition is met and to perform logic implementation for controlling the rotation of the virtual prop, and the following description is made with respect to the relevant setting of the virtual shooting game for the user (game development side). Here, the related setting refers to providing corresponding adsorption setting switches for each virtual prop (or each type of virtual prop) in advance in the configuration interface, so that a user can respectively configure each virtual prop (or each type of virtual prop) in the configuration interface, for example, for the virtual prop a, the corresponding adsorption setting switch can be displayed, if adsorption is set to be on, the virtual prop a can perform a subsequent adsorption execution step, for the virtual prop B, if adsorption is set to be off, the virtual prop B cannot perform a subsequent adsorption execution step.
Specifically, taking each virtual prop as an example, corresponding adsorption configuration can be performed for the virtual prop in different states, where the different states may include a single-hand gun state, a double-hand gun state, a single-hand mirror-opening state, a double-hand mirror-opening state, and the like, for example, if a user selects to turn on an adsorption setting switch of "single-hand gun state" in the single-hand gun state, in a game process, in the single-hand gun state of the user, the logic of judging whether the preset adsorption condition is satisfied and controlling the rotation of the virtual prop is performed, or else, if the adsorption setting switch in the state is not turned on, the logic cannot be implemented in the state.
In addition, for the non-shooting state, adsorption setting switches are respectively arranged for the single-hand gun holding state, the double-hand gun holding state, the single-hand mirror opening state and the double-hand mirror opening state, and for the shooting state, adsorption setting switches are respectively arranged for the single-hand gun holding state, the double-hand gun holding state, the single-hand mirror opening state and the double-hand mirror opening state, so that whether adsorption can be carried out or not can be respectively controlled for the non-shooting state and the shooting state of the virtual prop, and the richness of games is facilitated to be improved.
It will be appreciated by those skilled in the art that in the above-described method of the specific embodiments, the written order of steps is not meant to imply a strict order of execution but rather should be construed according to the function and possibly inherent logic of the steps.
Based on the same inventive concept, the embodiments of the present disclosure further provide a control device for a virtual prop corresponding to the control method for a virtual prop, and since the principle of solving the problem by the device in the embodiments of the present disclosure is similar to that of the control method for a virtual prop in the embodiments of the present disclosure, the implementation of the device may refer to the implementation of the method, and the repetition is omitted.
Referring to fig. 5, which is a schematic diagram of a control device for a virtual prop according to some embodiments of the present disclosure, the device 500 includes:
the display module 510 is configured to display a virtual scene, where the virtual scene includes a virtual object and a virtual prop for shooting the virtual object, where the virtual prop is provided with a holding point;
the judging module 520 is configured to obtain control information for the virtual prop, and judge whether the virtual prop meets a preset adsorption condition for shooting the virtual object based on the control information;
and the control module 530 is configured to control the virtual prop to rotate around the holding point so as to aim an aiming ray of the virtual prop at the virtual object, where the aiming ray is used to characterize a direction aimed by the virtual prop, when the virtual prop meets the preset adsorption condition.
In one possible implementation, the virtual object is provided with an aiming reference line; the control module 530 is specifically configured to:
and determining the rotation speed of the virtual prop based on the relative position relation between the aiming point corresponding to the aiming ray of the virtual prop and the aiming reference line, and controlling the virtual prop to rotate with the holding point as the center according to the rotation speed so as to enable the aiming point corresponding to the aiming ray of the virtual prop to be positioned on the aiming reference line of the virtual object.
In a possible implementation manner, the virtual object is provided with an adsorption frame, the adsorption frame refers to an aiming area of the virtual object, the control information comprises shooting state information of the virtual prop, and the shooting state information comprises an un-shooting state; the control module 530 is specifically configured to:
determining the rotation speed of the virtual prop based on the relative position relation between the aiming point corresponding to the aiming ray of the virtual prop and the aiming reference line and the relative position relation between the aiming reference line and the target frame of the adsorption frame; the target frame is a frame with the minimum distance from the aiming point in the adsorption frame.
In one possible implementation, the virtual object is provided with an aiming reference line; the control module 530 is specifically configured to:
determining a target rotation mode of the virtual prop based on a relative position relation between an aiming point corresponding to the aiming ray of the virtual prop and the aiming reference line; the target rotation mode comprises a parallel rotation mode and/or a pitching rotation mode;
and controlling the virtual prop to rotate by taking the holding point as the center according to the target rotation mode.
In one possible implementation, the virtual object has an adsorption frame, and the adsorption frame refers to an aiming area of the virtual object; the judging module 520 is specifically configured to:
judging whether the distance between the virtual prop and the virtual object is within a preset distance range or not and judging whether an aiming point corresponding to an aiming ray of the virtual prop is positioned in an adsorption frame of the virtual object or not;
if the distance between the virtual prop and the virtual object is within the preset distance range and the aiming point corresponding to the aiming ray of the virtual prop is positioned in the adsorption frame of the virtual object, determining that the virtual prop meets the preset adsorption condition.
In a possible implementation manner, the control information further comprises shooting state information of the virtual prop, wherein the shooting state information comprises an un-shooting state; the judging module 520 is specifically configured to:
and if the shooting state information of the virtual prop is the non-shooting state, determining that the virtual prop accords with the preset adsorption condition if the approach speed of the aiming point corresponding to the aiming ray of the virtual prop to the virtual object is smaller than a preset speed threshold value.
In a possible embodiment, the control information further includes shooting status information of the virtual prop, the shooting status information including an in-shooting status; the judging module 520 is specifically configured to:
and if the shooting state information indicates that the virtual prop is in the shooting state, determining that the virtual prop accords with the preset adsorption condition.
In one possible embodiment, the virtual ballast has a shooting adsorption cooling time; the judging module 520 is specifically configured to:
if the virtual prop is not in the shooting adsorption cooling time and the shooting state information indicates that the virtual prop is in the shooting state, determining that the virtual prop meets the preset adsorption condition.
In a possible implementation manner, the absorption frame is obtained by scaling an original frame based on a scaling ratio, wherein the scaling ratio is positively correlated with the distance from the virtual prop to the virtual object; and/or, the scaling is positively correlated with the magnification of the sighting telescope of the virtual prop assembly.
In one possible implementation, the obtaining module 510 is further configured to:
acquiring real pose information of entity control equipment corresponding to the virtual prop under a world coordinate system under the condition that the virtual prop does not meet the preset adsorption condition;
The control module 530 is further configured to:
based on the real pose information of the entity control equipment, determining virtual pose information corresponding to the real pose information under a virtual world coordinate system, and controlling the virtual prop to recover to a pose state matched with the entity control equipment according to the virtual pose information.
The process flow of each module in the apparatus and the interaction flow between the modules may be described with reference to the related descriptions in the above method embodiments, which are not described in detail herein.
Based on the same technical concept, the embodiment of the disclosure also provides electronic equipment. Referring to fig. 6, a schematic structural diagram of an electronic device 600 according to an embodiment of the present disclosure includes a processor 601, a memory 602, and a bus 603. The memory 602 is used for storing execution instructions, including a memory 6021 and an external memory 6022; the memory 6021 is also referred to as an internal memory, and is used for temporarily storing operation data in the processor 601 and data exchanged with an external memory 6022 such as a hard disk, and the processor 601 exchanges data with the external memory 6022 via the memory 6021.
In the embodiment of the present application, the memory 602 is specifically configured to store application program codes for executing the solution of the present application, and the processor 601 controls the execution. That is, when the electronic device 600 is running, communication between the processor 601 and the memory 602 is via the bus 603, such that the processor 601 executes the application code stored in the memory 602, thereby performing the method described in any of the previous embodiments.
The Memory 602 may be, but is not limited to, random access Memory (Random Access Memory, RAM), read Only Memory (ROM), programmable Read Only Memory (Programmable Read-Only Memory, PROM), erasable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable Read Only Memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.
The processor 601 may be an integrated circuit chip with signal processing capabilities. The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It should be understood that the structures illustrated in the embodiments of the present application do not constitute a particular limitation of the electronic device 600. In other embodiments of the present application, electronic device 600 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The disclosed embodiments also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of controlling a virtual prop in the method embodiments described above. Wherein the storage medium may be a volatile or nonvolatile computer readable storage medium.
The embodiments of the present disclosure further provide a computer program product, where the computer program product carries program code, where instructions included in the program code may be used to perform the steps of controlling a virtual prop in the foregoing method embodiments, and specifically reference may be made to the foregoing method embodiments, which are not described herein.
Wherein the above-mentioned computer program product may be realized in particular by means of hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied as a computer storage medium, and in another alternative embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), or the like.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system and apparatus may refer to corresponding procedures in the foregoing method embodiments, which are not described herein again. In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present disclosure may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer readable storage medium executable by a processor. Based on such understanding, the technical solution of the present disclosure may be embodied in essence or a part contributing to the prior art or a part of the technical solution, or in the form of a software product stored in a storage medium, including several instructions for causing an electronic device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present disclosure. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk.
Finally, it should be noted that: the foregoing examples are merely specific embodiments of the present disclosure, and are not intended to limit the scope of the disclosure, but the present disclosure is not limited thereto, and those skilled in the art will appreciate that while the foregoing examples are described in detail, it is not limited to the disclosure: any person skilled in the art, within the technical scope of the disclosure of the present disclosure, may modify or easily conceive changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features thereof; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the disclosure, and are intended to be included within the scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (13)

1. The control method of the virtual prop is characterized by comprising the following steps:
displaying a virtual scene, wherein the virtual scene comprises a virtual object and a virtual prop for shooting the virtual object, and the virtual prop is provided with a holding point;
acquiring control information aiming at the virtual prop, and judging whether the virtual prop meets preset adsorption conditions for shooting the virtual object or not based on the control information;
and under the condition that the virtual prop meets the preset adsorption condition, controlling the virtual prop to rotate by taking a holding point as a center so as to aim an aiming ray of the virtual prop at the virtual object, wherein the aiming ray is used for representing the aiming direction of the virtual prop.
2. The method of claim 1, wherein the virtual object is provided with an aiming reference line; the controlling the virtual prop to rotate with the holding point as a center so as to aim the aiming rays of the virtual prop at the virtual object comprises:
and determining the rotation speed of the virtual prop based on the relative position relation between the aiming point corresponding to the aiming ray of the virtual prop and the aiming reference line, and controlling the virtual prop to rotate with the holding point as the center according to the rotation speed so as to enable the aiming point corresponding to the aiming ray of the virtual prop to be positioned on the aiming reference line of the virtual object.
3. The method according to claim 2, wherein the virtual object is provided with an adsorption frame, the adsorption frame referring to an aiming area of the virtual object, the control information including shooting status information of the virtual prop, the shooting status information including an unreshooting status; the determining the rotation speed of the virtual prop based on the relative position relation between the aiming point corresponding to the aiming ray of the virtual prop and the aiming reference line comprises the following steps:
determining the rotation speed of the virtual prop based on the relative position relation between the aiming point corresponding to the aiming ray of the virtual prop and the aiming reference line and the relative position relation between the aiming reference line and the target frame of the adsorption frame; the target frame is a frame with the minimum distance from the aiming point in the adsorption frame.
4. A method according to any one of claims 1-3, wherein the virtual object is provided with an aiming reference line; the controlling the virtual prop to rotate with the holding point as a center comprises:
determining a target rotation mode of the virtual prop based on a relative position relation between an aiming point corresponding to the aiming ray of the virtual prop and the aiming reference line; the target rotation mode comprises a parallel rotation mode and/or a pitching rotation mode;
And controlling the virtual prop to rotate by taking the holding point as the center according to the target rotation mode.
5. The method of any one of claims 1-4, wherein the virtual object has an adsorption frame, the adsorption frame referring to an aiming area of the virtual object; the judging whether the virtual prop meets the preset adsorption condition for shooting the virtual object based on the control information comprises the following steps:
judging whether the distance between the virtual prop and the virtual object is within a preset distance range or not and judging whether an aiming point corresponding to an aiming ray of the virtual prop is positioned in an adsorption frame of the virtual object or not;
if the distance between the virtual prop and the virtual object is within the preset distance range and the aiming point corresponding to the aiming ray of the virtual prop is positioned in the adsorption frame of the virtual object, determining that the virtual prop meets the preset adsorption condition.
6. The method of claim 5, wherein the control information further comprises shooting status information of the virtual prop, the shooting status information comprising an unremitted status; the determining that the virtual prop meets the preset adsorption condition includes:
And if the shooting state information of the virtual prop is the non-shooting state, determining that the virtual prop accords with the preset adsorption condition if the approach speed of the aiming point corresponding to the aiming ray of the virtual prop to the virtual object is smaller than a preset speed threshold value.
7. The method of claim 5, wherein the control information further comprises shooting status information of the virtual prop, the shooting status information comprising an in-shooting status; the determining that the virtual prop meets the preset adsorption condition includes:
and if the shooting state information indicates that the virtual prop is in the shooting state, determining that the virtual prop accords with the preset adsorption condition.
8. The method of claim 5, wherein the virtual ballast has a shooting adsorption cooling time; if the shooting state information indicates that the virtual prop is in the shooting state, determining that the virtual prop meets the preset adsorption condition includes:
if the virtual prop is not in the shooting adsorption cooling time and the shooting state information indicates that the virtual prop is in the shooting state, determining that the virtual prop meets the preset adsorption condition.
9. The method according to any one of claims 3 to 8, wherein the adsorbing frame is obtained by scaling an original frame based on a scaling ratio, wherein the scaling ratio is positively correlated with a distance from the virtual prop to the virtual object; and/or, the scaling is positively correlated with the magnification of the sighting telescope of the virtual prop assembly.
10. The method of any one of claims 1-9, wherein after the determining that the virtual prop meets the preset adsorption condition, the method further comprises:
acquiring real pose information of entity control equipment corresponding to the virtual prop under a world coordinate system under the condition that the virtual prop does not meet the preset adsorption condition;
based on the real pose information of the entity control equipment, determining virtual pose information corresponding to the real pose information under a virtual world coordinate system, and controlling the virtual prop to recover to a pose state matched with the entity control equipment according to the virtual pose information.
11. A control device for a virtual prop, comprising:
the display module is used for displaying a virtual scene, wherein the virtual scene comprises a virtual object and a virtual prop used for shooting the virtual object, and the virtual prop is provided with a holding point;
The judging module is used for acquiring control information aiming at the virtual prop and judging whether the virtual prop meets preset adsorption conditions for shooting the virtual object or not based on the control information;
and the control module is used for controlling the virtual prop to rotate by taking the holding point as a center under the condition that the virtual prop meets the preset adsorption condition so as to aim the aiming rays of the virtual prop at the virtual object, wherein the aiming rays are used for representing the aiming direction of the virtual prop.
12. An electronic device, comprising: a processor, a memory and a bus, said memory storing machine-readable requests executable by said processor, said processor and said memory communicating over the bus when the electronic device is running, said machine-readable requests when executed by said processor performing the steps of the method of controlling a virtual prop according to any of claims 1 to 10.
13. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps of the method of controlling a virtual prop according to any of claims 1 to 10.
CN202311212087.4A 2023-09-19 2023-09-19 Virtual prop control method and device, electronic equipment and storage medium Pending CN117270685A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311212087.4A CN117270685A (en) 2023-09-19 2023-09-19 Virtual prop control method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311212087.4A CN117270685A (en) 2023-09-19 2023-09-19 Virtual prop control method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117270685A true CN117270685A (en) 2023-12-22

Family

ID=89207409

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311212087.4A Pending CN117270685A (en) 2023-09-19 2023-09-19 Virtual prop control method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117270685A (en)

Similar Documents

Publication Publication Date Title
US11712634B2 (en) Method and apparatus for providing online shooting game
JP5411473B2 (en) Program and game device
CN110339562B (en) Virtual object control method, device, terminal and storage medium
KR102629359B1 (en) Virtual object attack prompt method and device, and terminal and storage medium
JP2021514701A (en) Equipment display methods, devices, devices, storage media and computer programs in virtual environment battles
US20230256338A1 (en) Method for controlling call object in virtual scene, apparatus for controlling call object in virtual scene, device, storage medium, and program product
CN111202979B (en) Virtual item control method and device, electronic equipment and storage medium
JP7447296B2 (en) Interactive processing method, device, electronic device and computer program for virtual tools
CN111803944B (en) Image processing method and device, electronic equipment and storage medium
WO2023142617A1 (en) Virtual environment-based ray display method and apparatus, device, and storage medium
US20230364502A1 (en) Method and apparatus for controlling front sight in virtual scenario, electronic device, and storage medium
JP2003245465A (en) Game apparatus, game control program, and recording medium having the program recorded thereon
US20230330528A1 (en) Information determining method and apparatus, device, and storage medium
US20230030619A1 (en) Method and apparatus for displaying aiming mark
JP2008173491A (en) Image generator and information storage medium
CN117270685A (en) Virtual prop control method and device, electronic equipment and storage medium
CN112915532B (en) Information prompting method and device in game, electronic equipment and storage medium
CN112156472B (en) Control method, device and equipment of virtual prop and computer readable storage medium
JP4114825B2 (en) Image generating apparatus and information storage medium
CN112121433A (en) Method, device and equipment for processing virtual prop and computer readable storage medium
CN113730909B (en) Aiming position display method and device, electronic equipment and storage medium
CN117148972A (en) Virtual prop control method and device, electronic equipment and storage medium
CN113599828A (en) Control method and device of virtual prop, storage medium and electronic equipment
CN115300913A (en) Control method and device of shooting game, electronic equipment and storage medium
CN113797557A (en) Game control method and device, 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