Virtual prop control method and device, storage medium and electronic device
By launching multiple collision detection rays in the launch direction of the virtual shooting props, the locking state of the virtual object is determined, and the problem of low control efficiency of virtual props is solved, and more efficient virtual prop operations are achieved.
Patent Information
- Application Number
- CN202111117666.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-23
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2041-09-23
AI Technical Summary
The control efficiency of virtual props in existing game applications is low, especially when detecting collisions between virtual shooting props and multiple objects, resulting in large performance consumption and reducing control efficiency.
By firing the first collision detection ray in the launch direction of the virtual shooting prop, detecting the virtual object that allows the attack operation. If the object is detected, the second collision detection ray is emitted to detect the blocking object, thereby determining whether the locking is successful or failed, reducing the Detection of all virtual objects.
By reducing the number of detected virtual objects, the control efficiency of virtual props is improved, performance consumption is reduced, and the operation performance of virtual props in the game is improved.
Smart Images

Figure CN114011074B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a control method and device for a virtual item, a storage medium and an electronic device. Background Art
[0002] In existing game applications, collision detection is required between virtual objects to achieve corresponding interactive functions. For example, a virtual object uses a virtual shooting prop to shoot other virtual objects in a virtual game scene, and ray detection is used to detect colliding objects. For example, a ray is emitted in front of the virtual character, and then the ray returns a virtual object or multiple objects detected by the ray. However, in the game development process, all objects encountered by the detection are often returned, resulting in a technical problem of low control efficiency of virtual props.
[0003] For example, when the virtual shooting prop is a virtual rocket launcher, the principle of its locking is to detect whether there is a vehicle in the launching direction of the virtual rocket launcher. The existing judgment method is to detect all objects between the rocket launcher and the vehicle. When there are a large number of objects between the two, all objects need to be collided. Detection, resulting in very large performance consumption, further reduces the control efficiency of the virtual props.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a method and device for controlling a virtual prop, a storage medium, and an electronic device, so as to at least solve the technical problem of low control efficiency of virtual props existing in the related art.
[0006] According to one aspect of an embodiment of the present invention, a method for controlling a virtual prop is provided, comprising: displaying a virtual game scene where a first virtual character is located, wherein the first virtual character currently uses a virtual shooting prop; emitting a first collision detection ray in a launch direction of the virtual shooting prop, wherein the first collision detection ray is used to detect a first type of virtual object in the launch direction, and the first type of virtual object is a virtual object that allows the virtual shooting prop to perform an attack operation; in a case where a first detection result of the first collision detection ray indicates that a first virtual object of the first type is detected in the launch direction, emitting a second collision detection ray in the launch direction, wherein the second collision detection ray is used to detect a second type of virtual object before the first virtual object in the launch direction, and the second type of virtual object is used to block the virtual shooting prop from performing an attack operation on the first virtual object;
[0007] According to another aspect of an embodiment of the present invention, a control device for a virtual prop is further provided, comprising: a first display module, for displaying a virtual game scene where a first virtual character is located, wherein the first virtual character currently uses a virtual shooting prop; a first transmitting module, for transmitting a first collision detection ray in the transmitting direction of the virtual shooting prop, wherein the first collision detection ray is used to detect a first type of virtual object in the transmitting direction, and the first type of virtual object is a virtual object that allows the virtual shooting prop to perform an attack operation; a second transmitting module, for transmitting a second collision detection ray in the transmitting direction when a first detection result of the first collision detection ray indicates that a first virtual object of the first type is detected in the transmitting direction, wherein the second collision detection ray is used to detect a second type of virtual object before the first virtual object in the transmitting direction, and the second type of virtual object is used to block the virtual shooting prop from performing an attack operation on the first virtual object; and a second display module, for displaying a locking success mark when a second detection result of the second collision detection ray indicates that the second type of virtual object is not detected before the first virtual object in the transmitting direction, wherein the locking success mark is used to indicate that the virtual shooting prop has locked the first virtual object as a virtual object to be attacked by the virtual shooting prop.
[0008] Optionally, the device is also used for: when the first detection result of the first collision detection ray indicates that the first virtual object of the first type is detected in the emission direction, emitting a third collision detection ray in the emission direction, wherein the third collision detection ray is used to detect the first collided virtual object in the emission direction; the device is used to emit a second collision detection ray in the emission direction in the following manner: when the third detection result of the third collision detection ray indicates that the first collided third virtual object is detected in the emission direction and the third virtual object is not the second type of virtual object, emitting the second collision detection ray in the emission direction, wherein the second collision detection ray is used to detect the second type of virtual object between the first virtual object and the third virtual object in the emission direction.
[0009] Optionally, the device is used to emit the second collision detection ray in the emission direction when the third detection result of the third collision detection ray indicates that the first collided third virtual object is detected in the emission direction and the third virtual object is not the second type of virtual object in the following manner: determine the target position of the third virtual object in the emission direction when the third detection result of the third collision detection ray indicates that the first collided third virtual object is detected in the emission direction and the third virtual object is not the second type of virtual object; and emit the second collision detection ray in the emission direction, wherein the second collision detection ray is configured to detect the second type of virtual object starting from the target position.
[0010] Optionally, the device is also used to: display a locking failure mark when the second detection result of the second collision detection ray indicates that a second virtual object of the second type is detected before the first virtual object in the emission direction, wherein the locking failure mark is used to indicate that the virtual shooting prop cannot lock the first virtual object as a virtual object to be attacked.
[0011] Optionally, the device is also used to: when the virtual shooting prop is configured to perform a virtual attack operation along a straight line, emit the second collision detection ray along a straight line in the emission direction; or, when the virtual shooting prop is configured to perform a virtual attack operation along a curve, emit the second collision detection ray along a curve in the emission direction.
[0012] Optionally, the device is also used to: after displaying a locking success mark, emit a fourth collision detection ray in the emission direction, wherein the fourth collision detection ray is used to detect a third type of virtual object in the emission direction, and the third type of virtual object is used to reduce the attack parameters of the virtual shooting prop; when a fourth detection result of the fourth collision detection ray indicates that the third type of virtual object is detected before the first virtual object in the emission direction, display an interference mark, wherein the interference mark is used to indicate that when the virtual shooting prop has locked the first virtual object as the virtual object to be attacked, the attack operation performed by the virtual shooting prop will be interfered with.
[0013] Optionally, the device is used to emit a second collision detection ray in the emission direction in the following manner: emitting the second collision detection ray in the emission direction, wherein the second collision detection ray is configured to, when the second collision detection ray collides with a preset virtual object of the second type, provide feedback for indicating a detection result of detecting the second type of virtual object, otherwise, provide feedback for indicating a detection result of not detecting the second type of virtual object.
[0014] Optionally, the device is also used to: before emitting the second collision detection ray in the emission direction, obtain the second type set for the virtual shooting prop; according to the second type, configure the second collision detection ray to be emitted, so that when the second collision detection ray collides with a preset virtual object of the second type, feedback is used to indicate a detection result of detecting the virtual object of the second type, otherwise, feedback is used to indicate a detection result of not detecting the virtual object of the second type.
[0015] Optionally, the device is used to emit a second collision detection ray in the emission direction in the following manner: emit the second collision detection ray in the emission direction, wherein the second collision detection ray is used to detect a virtual object of an obstacle type before the first virtual object in the emission direction, and the second type is the obstacle type.
[0016] Optionally, the apparatus is further configured to: configure the first type of virtual object as a virtual object located at a first level; and configure the first collision detection ray to only allow detection of whether a collision occurs with the virtual object located at the first level.
[0017] Optionally, the apparatus is further configured to: configure the second type of virtual object as a virtual object located at a second level; and configure the second collision detection ray to only allow detection of whether a collision occurs with the virtual object located at the second level.
[0018] Optionally, the device is also used to: configure the second type of virtual object as a virtual object located at a third level, wherein the third level is greater than the first level; and configure the second collision detection ray to allow detection of virtual objects located at a level greater than the first level and less than or equal to the third level.
[0019] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned virtual item control method when running.
[0020] According to another aspect of the embodiment of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the control method of the virtual props as described above.
[0021] According to another aspect of an embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the virtual item control method through the computer program.
[0022] In an embodiment of the present invention, a virtual game scene where a first virtual character is located is displayed, a first collision detection ray is emitted in the emission direction of a virtual shooting prop, and when a first detection result of the first collision detection ray indicates that a first virtual object of the first type is detected in the emission direction, a second collision detection ray is emitted in the emission direction, and when a second detection result of the second collision detection ray indicates that no virtual object of the second type is detected before the first virtual object in the emission direction, a locking success mark is displayed. By first emitting a detection ray for detecting a first type of virtual object, and then emitting a detection ray for detecting a second type of virtual object when the detection result of the first collision detection ray indicates that the first virtual object is detected, the purpose of avoiding the need to detect all virtual objects is achieved, thereby achieving the technical effect of reducing the number of virtual objects that need to be detected by the detection ray and improving the control efficiency of the virtual props, thereby solving the technical problem of low control efficiency of virtual props existing in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0024] Figure 1 is a schematic diagram of an application environment of an optional virtual prop control method according to an embodiment of the present invention;
[0025] Figure 2 is a flow chart of an optional method for controlling a virtual prop according to an embodiment of the present invention;
[0026] Figure 3 is a schematic diagram of an optional method for controlling a virtual prop according to an embodiment of the present invention;
[0027] Figure 4is a schematic diagram of another optional control method of a virtual prop according to an embodiment of the present invention;
[0028] Figure 5 is a schematic diagram of another optional control method of a virtual prop according to an embodiment of the present invention;
[0029] Figure 6 is a schematic diagram of another optional control method of a virtual prop according to an embodiment of the present invention;
[0030] Figure 7 is a schematic diagram of another optional control method of a virtual prop according to an embodiment of the present invention;
[0031] Figure 8 is a schematic diagram of another optional control method of a virtual prop according to an embodiment of the present invention;
[0032] Fig. 9 is a schematic diagram of another optional control method of a virtual prop according to an embodiment of the present invention;
[0033] Fig.10 is a schematic diagram of another optional control method of a virtual prop according to an embodiment of the present invention;
[0034] Fig.11 is a schematic structural diagram of an optional virtual prop control device according to an embodiment of the present invention;
[0035] Fig.12 is a schematic diagram of the structure of an optional computer product according to an embodiment of the present invention;
[0036] Fig.13 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0039] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following interpretation:
[0040] Shooting applications: including first-person shooting applications, third-person shooting applications, and other games including but not limited to all games that use hot weapons for long-range attacks.
[0041] First-person shooting game (FPS) is a branch of action game (ACT). As the name suggests, the first-person shooting application is a shooting application that shoots from the operator's subjective perspective.
[0042] A third-person shooting game (TPS) is also a type of shooting application. The difference between a third-person shooting game and a first-person shooting game is that a virtual control object controlled by an operator is visible in the application display interface.
[0043] The present invention will be described below in conjunction with embodiments:
[0044] According to one aspect of an embodiment of the present invention, a method for controlling a virtual prop is provided. Optionally, in this embodiment, the method for controlling a virtual prop can be applied to: Figure 1 In the hardware environment composed of the server 101 and the terminal device 103 shown in FIG. Figure 1As shown, the server 101 is connected to the terminal 103 through a network, and can be used to provide services for the terminal device or the application installed on the terminal device. The application can be a video application, an instant messaging application, a browser application, an educational application, a game application, etc. A database 105 can be set on the server or independently of the server to provide data storage services for the server 101, for example, a game data storage server. The above network can include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network and a wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that realize wireless communication. The terminal device 103 can be a terminal configured with an application, and can include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV and other computer devices. The above server can be a single server, or a server cluster composed of multiple servers, or a cloud server.
[0045] Combination Figure 1 As shown, the above-mentioned virtual props control method can be implemented in the terminal device 103 through the following steps:
[0046] S1, displaying a virtual game scene where a first virtual character is located on the terminal device 103, wherein the first virtual character currently uses a virtual shooting prop;
[0047] S2, emitting a first collision detection ray in the emission direction of the virtual shooting prop on the terminal device 103, wherein the first collision detection ray is used to detect a first type of virtual object in the emission direction, and the first type of virtual object is a virtual object that allows the virtual shooting prop to perform an attack operation;
[0048] S3, when the first detection result of the first collision detection ray on the terminal device 103 indicates that a first virtual object of the first type is detected in the emission direction, a second collision detection ray is emitted in the emission direction, wherein the second collision detection ray is used to detect a second type of virtual object before the first virtual object in the emission direction, and the second type of virtual object is used to block the virtual shooting prop from performing an attack operation on the first virtual object;
[0049] S4. When the second detection result of the second collision detection ray on the terminal device 103 indicates that no virtual object of the second type is detected before the first virtual object in the emission direction, a locking success mark is displayed, wherein the locking success mark is used to indicate that the virtual shooting prop has locked the first virtual object as the virtual object to be attacked.
[0050] Optionally, in this embodiment, the control method of the virtual props can also be implemented by a server, for example, Figure 1 It is implemented in the server 101 shown; or it is implemented by the user terminal and the server together.
[0051] The above is only an example and is not specifically limited in this embodiment.
[0052] Optionally, as an optional implementation, as Figure 2 As shown, the control method of the virtual props includes:
[0053] S202, displaying a virtual game scene where the first virtual character is located, wherein the first virtual character is currently using a virtual shooting prop;
[0054] S204, emitting a first collision detection ray in the emission direction of the virtual shooting prop, wherein the first collision detection ray is used to detect a first type of virtual object in the emission direction, and the first type of virtual object is a virtual object that allows the virtual shooting prop to perform an attack operation;
[0055] S206, when the first detection result of the first collision detection ray indicates that a first virtual object of the first type is detected in the emission direction, a second collision detection ray is emitted in the emission direction, wherein the second collision detection ray is used to detect a second virtual object before the first virtual object in the emission direction, and the second virtual object is used to block the virtual shooting prop from performing an attack operation on the first virtual object;
[0056] S208, when the second detection result of the second collision detection ray indicates that no virtual object of the second type is detected before the first virtual object in the emission direction, a locking success mark is displayed, wherein the locking success mark is used to indicate that the virtual shooting prop has locked the first virtual object as the virtual object to be attacked.
[0057] Optionally, in this embodiment, the control method of the virtual props can be applied to shooting game applications installed on computer devices including but not limited to mobile phones (such as Android phones, iOS phones, etc.), laptops, tablet computers, PDAs, MIDs (Mobile Internet Devices), PADs, desktop computers, smart TVs, etc. The target game applications include first-person shooting game applications, third-person shooting game applications, and shooting game applications that can switch between the first-person and third-person perspectives, etc., wherein, Figure 3 is a schematic diagram of a method for controlling a virtual character according to an embodiment of the present invention. Figure 3As shown, the application display interface can be divided into a first-person display interface 301 and a third-person display interface 303, as well as a display interface including but not limited to a display interface for switching between the first-person and third-person views using a perspective switching button. Figure 3 The environment shown in FIG. 1 shows that the first virtual object is currently using a virtual shooting prop in the target game application.
[0058] Optionally, in this embodiment, the type of the above-mentioned game application may include but is not limited to at least one of the following: two-dimensional (Two Dimension, 2D for short) game application, three-dimensional (Three Dimension, 3D for short) game application, virtual reality (Virtual Reality, VR for short) game application, augmented reality (Augmented Reality, AR for short) game application, mixed reality (Mixed Reality, MR for short) game application.
[0059] Optionally, in this embodiment, the virtual game scene where the above-mentioned first virtual character is located may include but is not limited to being rendered by the terminal according to the shooting game application data sent by the server, and may also include but is not limited to being rendered by the terminal according to the storage data of the shooting game application.
[0060] Optionally, in this embodiment, the above-mentioned first virtual character includes but is not limited to a virtual operation object controlled by the user through a participating account in the above-mentioned game application, and may also include but is not limited to a system-preset virtual object generated by a server that is in the same camp as the virtual character controlled by the participating account.
[0061] The above is only an example, and this embodiment does not make any specific limitation.
[0062] Optionally, in this embodiment, the application scenarios of the above-mentioned virtual props control method may include but are not limited to target game applications in various application scenarios such as medical care, finance, credit reporting, banking, government affairs, government, energy, education, security, buildings, games, transportation, Internet of Things, and industry.
[0063] Optionally, in this embodiment, the above-mentioned virtual shooting props may include but are not limited to virtual firearms, virtual bows and arrows, virtual rockets, etc., and the above-mentioned launching direction may include but is not limited to the above-mentioned first collision detection ray launched along the crosshair direction of the first virtual character with the position of the above-mentioned first virtual character as the starting point, and may also include but is not limited to the above-mentioned first collision detection ray launched along the crosshair direction of the first virtual character with the position of the virtual shooting prop as the starting point. The above-mentioned first collision detection ray is used to detect whether there is a first type of virtual object in the launching direction.
[0064] For example, Figure 4is a schematic diagram of another method for controlling a virtual character according to an embodiment of the present invention. Figure 4 As shown, a first virtual character 404 and a first type of virtual object 406 are displayed in a display interface 402 of a terminal device. In the game scene, a virtual shooting prop is configured to move with the first virtual character 404. At this time, emitting a first collision detection ray in the emission direction of the virtual shooting prop may include but is not limited to emitting a first collision detection ray in the emission direction of the virtual shooting prop with the first virtual character 404 as the starting point to detect whether there is a first type of virtual object 406 in the emission direction.
[0065] In addition, it may also include but is not limited to displaying a first virtual character 410, a virtual shooting prop 412 and a first type of virtual object 414 on the display interface 408 of the terminal device. In the game scene, the virtual shooting prop is configured to allow independent movement. At this time, emitting a first collision detection ray in the emission direction of the virtual shooting prop may include but is not limited to emitting a first collision detection ray in the emission direction of the virtual shooting prop with the virtual shooting prop 412 as the starting point to detect whether there is a first type of virtual object 414 in the emission direction.
[0066] The above is only an example, and this embodiment does not make any specific limitation. The emission direction of the above virtual shooting props can be based on the first virtual character currently using the virtual shooting props, and the above first collision detection ray can be emitted. In addition, when the virtual shooting props and the first virtual character currently using the virtual shooting props are in different positions, the above first collision detection ray can be emitted from the position where the virtual shooting props are located.
[0067] Optionally, in this embodiment, the above-mentioned first type of virtual object is a virtual object that allows the virtual shooting prop to perform attack operations, which may include but is not limited to other virtual characters in the virtual game scene, virtual vehicles, virtual targets, etc., which allow the virtual shooting prop to perform attack operations.
[0068] Optionally, in this embodiment, the first detection result of the above-mentioned first collision detection ray may include but is not limited to detecting a first type of virtual object in the emission direction or not detecting the first type of virtual object. When the first detection result indicates that the first virtual object is detected, a second collision detection ray is emitted in the emission direction. When the first detection result indicates that the first type of virtual object is not detected, the current detection operation is ended, or the emission of the next first collision detection ray is started.
[0069] Optionally, in this embodiment, the second collision detection ray is used to detect a second type of virtual object in the firing direction of the virtual shooting prop, and the second type of virtual object is a virtual object that allows the virtual shooting prop to be blocked from performing an attack operation on the first virtual object, such as a virtual wall, a virtual protective shield, etc., and may include but is not limited to a virtual object that can intercept virtual bullets fired by the virtual shooting prop.
[0070] It should be noted that the starting point of the second collision detection ray may include but is not limited to the position of the first virtual character or the position of the virtual shooting prop, for example, Figure 5 is a schematic diagram of another method for controlling a virtual character according to an embodiment of the present invention. Figure 5 As shown, a first virtual character 504 and a first type of virtual object 506 are displayed in a display interface 502 of a terminal device. In the game scene, a virtual shooting prop is configured to move with the first virtual character 504. At this time, emitting a second collision detection ray in the emission direction of the virtual shooting prop may include but is not limited to emitting a second collision detection ray in the emission direction of the virtual shooting prop with the first virtual character 504 as the starting point to detect whether there is a second type of virtual object 516 in the emission direction.
[0071] In addition, it may also include but is not limited to displaying a first virtual character 510, a virtual shooting prop 512 and a first type of virtual object 514 on the display interface 508 of the terminal device. In the game scene, the virtual shooting prop is configured to allow independent movement. At this time, emitting a second collision detection ray in the emission direction of the virtual shooting prop may include but is not limited to emitting a second collision detection ray in the emission direction of the virtual shooting prop with the virtual shooting prop 512 as the starting point to detect whether there is a second type of virtual object 518 in the emission direction.
[0072] The above is only an example, and this embodiment does not make any specific limitation. The emission direction of the above virtual shooting props can be based on the first virtual character currently using the virtual shooting props as the starting point to emit the above second collision detection ray. In addition, when the virtual shooting props and the first virtual character currently using the virtual shooting props are in different positions, the above second collision detection ray can be emitted from the position where the virtual shooting props are located.
[0073] Optionally, in this embodiment, the above-mentioned detection of the second type of virtual object before the first virtual object in the launch direction may include but is not limited to detecting the second type of virtual object in the area included between the first virtual character and the first virtual object, and the above-mentioned second detection result may include but is not limited to detecting the second type of virtual object between the first virtual character and the first virtual object or not detecting the second type of virtual object.
[0074] Optionally, in this embodiment, the above-mentioned locking success mark may include but is not limited to text, image, animation, voice and other identification information. Specifically, the locking success may also be indicated by color, size, symbol and the like.
[0075] Through this embodiment, a virtual game scene where a first virtual character is located is displayed, a first collision detection ray is emitted in the emission direction of a virtual shooting prop, and when a first detection result of the first collision detection ray indicates that a first virtual object of the first type is detected in the emission direction, a second collision detection ray is emitted in the emission direction, and when a second detection result of the second collision detection ray indicates that no virtual object of the second type is detected before the first virtual object in the emission direction, a locking success mark is displayed. By first emitting a detection ray for detecting a first type of virtual object, and then emitting a detection ray for detecting a second type of virtual object when the detection result of the first collision detection ray indicates that the first virtual object is detected, the purpose of avoiding the need to detect all virtual objects is achieved, thereby achieving the technical effect of reducing the number of virtual objects that need to be detected by the detection ray and improving the control efficiency of the virtual props, thereby solving the technical problem of low control efficiency of virtual props existing in the related art.
[0076] As an optional solution,
[0077] The method further includes: when the first detection result of the first collision detection ray indicates that a first virtual object of the first type is detected in the emission direction, emitting a third collision detection ray in the emission direction, wherein the third collision detection ray is used to detect the first collided virtual object in the emission direction;
[0078] Emitting a second collision detection ray in the emission direction, including: when a third detection result of the third collision detection ray indicates that a first collided third virtual object is detected in the emission direction and the third virtual object is not a virtual object of the second type, emitting a second collision detection ray in the emission direction, wherein the second collision detection ray is used to detect a virtual object of the second type between the first virtual object and the third virtual object in the emission direction.
[0079] Optionally, in this embodiment, the above-mentioned third collision detection ray is configured to detect only the first virtual object that collides in the emission direction and return the detection result. When the first third virtual object that collides is not a virtual object of the second type, the second collision detection ray is emitted in the emission direction to detect the second type of virtual object between the first virtual object and the third virtual object in the emission direction.
[0080] For example, Figure 6is a schematic diagram of another method for controlling a virtual character according to an embodiment of the present invention. Figure 6 As shown, in which, when the first detection result of the first collision detection ray indicates that a first virtual object of the first type is detected in the emission direction, the detected first virtual character 604 and the first virtual object 606 are displayed in the display interface 602 of the terminal device, and the emission of the third collision detection ray in the emission direction of the virtual shooting prop may include but is not limited to starting from the first virtual character 604, emitting the third collision detection ray in the emission direction of the virtual shooting prop to detect whether the first third virtual object detected to be collided in the emission direction is a virtual object of the second type. When it is detected that the first third virtual object to be collided is a virtual object of the second type, as shown in the display interface 610, when the third virtual object first collided by the third collision detection ray emitted from the first virtual character 604 is a virtual object of the second type, the game interface of the first virtual character is displayed as the third virtual object 608 and the locking failure mark, and when the third virtual object first collided by the third collision detection ray emitted from the first virtual character 604 is not a virtual object of the second type, the game interface of the first virtual character is displayed as the first virtual object 606 and the third virtual object 614 and the locking success mark.
[0081] It should be noted that the above-mentioned simultaneous display of the first virtual object 606 and the third virtual object 614 is an optional example, and specifically only the first virtual object 606 or the third virtual object 614 may be displayed. As long as the locking success mark is displayed, it means that the virtual shooting prop has locked the first virtual object as the virtual object to be attacked.
[0082] As an optional solution, when the third detection result of the third collision detection ray indicates that the first collided third virtual object is detected in the emission direction, and the third virtual object is not a virtual object of the second type, emitting a second collision detection ray in the emission direction, including:
[0083] When a third detection result of the third collision detection ray indicates that a first collided third virtual object is detected in the emission direction, and the third virtual object is not a virtual object of the second type, determining a target position of the third virtual object in the emission direction;
[0084] A second collision detection ray is emitted in the emission direction, wherein the second collision detection ray is configured to detect a second type of virtual object starting from the target position.
[0085] Optionally, in this embodiment, it may include but is not limited to obtaining the target position of the third virtual object in the virtual game scene when the third detection result of the third collision detection ray indicates that the third virtual object is not a virtual object of the second type. The target position must be a position in the launch direction of the virtual shooting prop. At this time, taking the above target position as the detection starting point, a second collision detection ray is re-launched toward the first virtual object in the launch direction.
[0086] For example, Figure 7 is a schematic diagram of another method for controlling a virtual character according to an embodiment of the present invention. Figure 7 As shown, the detected first virtual character 704 and the first virtual object 706 are displayed in the display interface 702 of the terminal device. When the third detection result of the third collision detection ray indicates that the first collided third virtual object 714 is detected in the emission direction, and the third virtual object 714 is not a virtual object of the second type, the target position of the third virtual object in the emission direction is determined. As shown in the display interface 708, a second collision detection ray is emitted from the target position in the emission direction of the virtual shooting prop to detect the second type of virtual object. At this time, the position of the first virtual character 710 is no longer the starting position of the second collision detection ray, but the target position of the third virtual object 714 is the starting position of the second collision detection ray, and the first virtual object 712 is still the end position of the second collision detection ray.
[0087] The above is only an example, and this embodiment does not make any specific limitation.
[0088] As an optional solution, the method further includes:
[0089] When the second detection result of the second collision detection ray indicates that a second virtual object of the second type is detected before the first virtual object in the emission direction, a locking failure mark is displayed, wherein the locking failure mark is used to indicate that the virtual shooting prop cannot lock the first virtual object as the virtual object to be attacked.
[0090] Optionally, in this embodiment, the second detection result of the second collision detection ray indicates that a second virtual object of the second type is detected before the first virtual object in the emission direction, which may include but is not limited to the second collision detection ray with the first virtual character as the starting point and the first virtual object as the end point detecting the second type of virtual object, or the second collision detection ray with the target position of the third virtual character as the starting point and the first virtual object as the end point detecting the second type of virtual object.
[0091] Optionally, in this embodiment, the above-mentioned lock failure mark may include but is not limited to text, images, animations, voice and other identification information. Specifically, the lock failure may also be indicated by color, size, symbol, etc., for example, Figure 6 The lock failure indicator is shown in the display interface 612.
[0092] As an optional solution, the method further includes:
[0093] In the case where the virtual shooting prop is configured to perform a virtual attack operation along a straight line, a second collision detection ray is emitted along a straight line in the emission direction; or,
[0094] In the case where the virtual shooting prop is configured to perform a virtual attack operation along a curve, a second collision detection ray is emitted along the curve in the emission direction.
[0095] Optionally, in this embodiment, the trajectory of the second collision detection ray may include but is not limited to being associated with the trajectory of the virtual shooting prop firing the virtual bullet. For example, when the virtual shooting prop performs a virtual attack operation along a straight line, the second collision detection ray is also fired along a straight line. When the virtual shooting prop performs a virtual attack operation along a curve, the second collision detection ray is also fired along the curve.
[0096] The above-mentioned first collision detection ray and the third collision detection ray can be configured to be emitted in the same manner as the second collision detection ray, or can be different. For example, the first collision detection ray is emitted along a straight line, and the second collision detection ray and the third collision detection ray are emitted along a curve, or the first collision detection ray and the third collision detection ray are emitted along a straight line, and the second collision detection ray is emitted along a curve.
[0097] For example, Figure 8 is a schematic diagram of another method for controlling a virtual character according to an embodiment of the present invention. Figure 8 As shown, when the virtual shooting prop performs a virtual attack operation along a straight line, the second collision detection ray is also emitted along a straight line. When the virtual shooting prop performs a virtual attack operation along a curve, the second collision detection ray is also emitted along the curve.
[0098] As an optional solution, after displaying the lock success mark, the method further includes:
[0099] Launching a fourth collision detection ray in the launching direction, wherein the fourth collision detection ray is used to detect a third type of virtual object in the launching direction, and the third type of virtual object is used to reduce the attack parameter of the virtual shooting prop;
[0100] When the fourth detection result of the fourth collision detection ray indicates that a third type of virtual object is detected before the first virtual object in the emission direction, an interference mark is displayed, wherein the interference mark is used to indicate that when the virtual shooting prop has locked the first virtual object as the virtual object to be attacked, the attack operation performed by the virtual shooting prop will be interfered with.
[0101] Optionally, in this embodiment, the fourth collision detection ray is configured to detect whether there is a third type of virtual object that interferes with the attack operation between the first virtual character and the first virtual object. For example, a virtual wall with a thickness greater than a preset threshold is a second type of virtual object, and a virtual wall with a thickness less than or equal to the above preset threshold is a third type of virtual object.
[0102] Optionally, in this embodiment, the attack operation performed by the above-mentioned virtual shooting props will be interfered with, including but not limited to the virtual damage caused by the above-mentioned attack operation being weakened. For example, when the third type of virtual object is not detected, the damage of the attack operation performed by the virtual shooting props is 50, and when the third type of virtual object is detected, the damage of the attack operation performed by the virtual shooting props is 25. In other words, the effect that the attack operation performed by the above-mentioned virtual shooting props will be interfered with can be associated with the third type of virtual object, and different third types of virtual objects can have different interference effects.
[0103] As an optional solution, a second collision detection ray is emitted in the emission direction, including:
[0104] A second collision detection ray is emitted in the emission direction, wherein the second collision detection ray is configured to, when the second collision detection ray collides with a preset second type of virtual object, provide feedback for indicating a detection result of detecting the second type of virtual object, otherwise, provide feedback for indicating a detection result of not detecting the second type of virtual object.
[0105] Optionally, in this embodiment, the detection result fed back by the above-mentioned second collision detection ray may include but is not limited to whether a second type of virtual object is detected. That is, the detection result fed back by the second collision detection ray does not need to detect all virtual objects on the path, but is only configured to detect the second type of virtual objects. When the second type of virtual object is detected, the detection result indicating that the second type of virtual object is detected is directly fed back, and virtual characters of other types except the second type will not be detected, so as to avoid the need to detect all virtual objects, thereby achieving the technical effect of reducing the number of virtual objects that need to be detected by the detection ray and improving the control efficiency of virtual props, thereby solving the technical problem of low control efficiency of virtual props existing in the related art.
[0106] As an optional solution, before emitting the second collision detection ray in the emission direction, the method further includes:
[0107] Get the second type set for the virtual shooting prop;
[0108] According to the second type, the second collision detection ray to be emitted is configured so that when the second collision detection ray collides with a preset second type of virtual object, feedback is used to indicate a detection result of detecting the second type of virtual object, otherwise, feedback is used to indicate a detection result of not detecting the second type of virtual object.
[0109] Optionally, in this embodiment, the above-mentioned configuration of the second collision detection ray to be emitted according to the second type may include but is not limited to being implemented in an editing application. Specifically, the second collision detection ray may be configured to only allow detection of virtual objects of the second type according to the types of different virtual objects in the game scene.
[0110] As an optional solution, a second collision detection ray is emitted in the emission direction, including:
[0111] A second collision detection ray is emitted in the emission direction, wherein the second collision detection ray is used to detect a virtual object of an obstacle type before the first virtual object in the emission direction, and the second type is an obstacle type.
[0112] Optionally, in this embodiment, the above obstacle types may include but are not limited to virtual walls, virtual protective covers, etc.
[0113] Taking the virtual shooting prop as a rocket launcher as an example, the second collision detection ray emitted in the emission direction may include but is not limited to the following examples:
[0114] For example, Fig. 9 is a schematic diagram of another method for controlling a virtual character according to an embodiment of the present invention. Fig. 9 As shown, the control method of the above virtual character may include but is not limited to the following steps:
[0115] S902, start;
[0116] S904, summoning a rocket launcher (the first virtual character currently uses a virtual shooting prop);
[0117] S906, determining whether the rocket launcher has started aiming, and if the determination result is no, returning to step S904;
[0118] S908, if the result of the judgment in step S906 is yes, it is detected that there is a vehicle in the direction of the rocket launcher (corresponding to the detection of the first virtual object by the aforementioned first collision detection ray);
[0119] S910, determining whether there is an object between the two (corresponding to whether the third collision detection ray detects a third type of virtual object). If the determination result is yes, executing step S912, otherwise, executing step S920;
[0120] S912, determining whether the third virtual object is an obstacle;
[0121] S914, if the result of the judgment in step S912 is yes, the locking fails, and a locking failure mark is displayed;
[0122] S916, if the result of the determination in step S912 is no, continue to determine whether there is an obstacle (corresponding to the detection of the second type of virtual object by the second collision detection ray) between the first object (corresponding to the target position where the third virtual object is located) and the vehicle (corresponding to the first virtual object).
[0123] S918, if the result of the judgment in step S916 is yes, the locking fails, and a locking failure mark is displayed;
[0124] S920: If the result of the judgment in step S916 is no or the result of the judgment in step S910 is no, the locking is successful, and a locking success mark is displayed;
[0125] S922, after displaying a lock failure mark or a lock success mark, the process ends.
[0126] The above is only an example, and this embodiment does not make any specific limitation.
[0127] As an optional solution, the above method also includes:
[0128] configuring the first type of virtual object as a virtual object located at a first level;
[0129] The first collision detection ray is configured to only allow collision detection with virtual objects located at the first level.
[0130] Optionally, in this embodiment, in the game editing application, the above-mentioned first type of virtual objects can be configured as first-level virtual objects, and then, the first collision detection ray can be configured to only allow detection of first-level virtual objects, so as to achieve the technical effect of reducing detection resource overhead and time consumption and improving the control efficiency of virtual objects.
[0131] As an optional solution, the method further includes:
[0132] configuring the second type of virtual object as a virtual object located at a second level;
[0133] The second collision detection ray is configured to only allow detection of collision with virtual objects located at the second level.
[0134] Optionally, in this embodiment, the second type of virtual object can be configured as a second-level virtual object in the game editing application, and then the second collision detection ray can be configured to only allow detection of second-level virtual objects, so as to achieve the technical effect of reducing detection resource overhead and time consumption and improving the control efficiency of virtual objects.
[0135] Optionally, in this embodiment, the second level is different from the first level and may be greater than or less than the first level. When the second level is greater than the first level, in the game editing application, the levels of different virtual objects may be arranged in descending order according to actual priorities. When the second level is less than the first level, in the game editing application, the levels of different virtual objects may be arranged in ascending order according to actual priorities.
[0136] As an optional solution, the method further includes:
[0137] configuring the second type of virtual object as a virtual object located at a third level, wherein the third level is greater than the first level;
[0138] The second collision detection ray is configured to allow detection of virtual objects located at a level greater than the first level and less than or equal to the third level.
[0139] Optionally, in this embodiment, the second type of virtual object can be configured as a virtual object of the third level, and the third level is greater than the first level. In this case, the second collision detection ray is configured to allow detection of virtual objects located at a level greater than the first level and less than or equal to the third level. That is, between the first level where the first type of virtual objects are located and the third level where the second type of virtual objects are located, virtual objects of other levels at the first level and the third level may also be included but not limited to, and may also be detected by the second collision detection ray.
[0140] For example, Fig.10 is a schematic diagram of another method for controlling a virtual character according to an embodiment of the present invention. Fig.10 As shown, the control method of the above virtual character may include but is not limited to the following steps:
[0141] S1, select the third level in the game editing interface;
[0142] S2: configure the virtual object corresponding to the third level as a second type of virtual object, and configure the second collision detection ray to allow detection of virtual objects located at a level greater than the first level and less than or equal to the third level.
[0143] Among them, the level of the obstacle is layer_StaticActor (the third level), and the level of the first virtual object is Layer_Weapon_UI (the first level). Since the level of layer_StaticActor is greater than the level of Layer_Weapon_UI, when the second collision detection ray is configured to allow detection of virtual objects at a level greater than the first level and less than or equal to the third level, the current second collision detection ray can detect other virtual objects at the level between layer_StaticActor and Layer_Weapon_UI, such as Layer_Fire.
[0144] The above is only an example, and this embodiment does not make any specific limitation.
[0145] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0146] According to another aspect of the embodiments of the present invention, a virtual prop control device for implementing the above virtual prop control method is also provided. Fig.11 As shown, the device comprises:
[0147] The first display module 1102 is used to display the virtual game scene where the first virtual character is located, wherein the first virtual character currently uses a virtual shooting prop;
[0148] A first transmitting module 1104 is used to transmit a first collision detection ray in a transmitting direction of the virtual shooting prop, wherein the first collision detection ray is used to detect a first type of virtual object in the transmitting direction, and the first type of virtual object is a virtual object that allows the virtual shooting prop to perform an attack operation;
[0149] A second transmitting module 1106 is configured to transmit a second collision detection ray in the transmitting direction when the first detection result of the first collision detection ray indicates that a first virtual object of the first type is detected in the transmitting direction, wherein the second collision detection ray is used to detect a second virtual object before the first virtual object in the transmitting direction, and the second virtual object is used to block the virtual shooting prop from performing an attack operation on the first virtual object;
[0150] The second display module 1108 is used to display a locking success mark when the second detection result of the second collision detection ray indicates that no second type of virtual object is detected before the first virtual object in the emission direction, wherein the locking success mark is used to indicate that the virtual shooting prop has locked the first virtual object as the virtual object to be attacked.
[0151] As an optional solution,
[0152] The device is further used to: when the first detection result of the first collision detection ray indicates that a first virtual object of the first type is detected in the emission direction, emit a third collision detection ray in the emission direction, wherein the third collision detection ray is used to detect the first collided virtual object in the emission direction;
[0153] The device is used to emit a second collision detection ray in an emission direction in the following manner: when a third detection result of the third collision detection ray indicates that a third virtual object that is first collided with is detected in the emission direction and the third virtual object is not a virtual object of the second type, the second collision detection ray is emitted in the emission direction, wherein the second collision detection ray is used to detect a virtual object of the second type between the first virtual object and the third virtual object in the emission direction.
[0154] As an optional solution, the device is used to transmit a second collision detection ray in the emission direction when the third detection result of the third collision detection ray indicates that the first collided third virtual object is detected in the emission direction and the third virtual object is not a virtual object of the second type in the following manner:
[0155] When a third detection result of the third collision detection ray indicates that a first collided third virtual object is detected in the emission direction, and the third virtual object is not a virtual object of the second type, determining a target position of the third virtual object in the emission direction;
[0156] A second collision detection ray is emitted in the emission direction, wherein the second collision detection ray is configured to detect a second type of virtual object starting from the target position.
[0157] As an optional solution, the device is also used to:
[0158] When the second detection result of the second collision detection ray indicates that a second virtual object of the second type is detected before the first virtual object in the emission direction, a locking failure mark is displayed, wherein the locking failure mark is used to indicate that the virtual shooting prop cannot lock the first virtual object as the virtual object to be attacked.
[0159] As an optional solution, the device is also used to:
[0160] In the case where the virtual shooting prop is configured to perform a virtual attack operation along a straight line, a second collision detection ray is emitted along a straight line in the emission direction; or,
[0161] In the case where the virtual shooting prop is configured to perform a virtual attack operation along a curve, a second collision detection ray is emitted along the curve in the emission direction.
[0162] As an optional solution, the device is also used to:
[0163] After the lock success mark is displayed, a fourth collision detection ray is emitted in the emission direction, wherein the fourth collision detection ray is used to detect a third type of virtual object in the emission direction, and the third type of virtual object is used to reduce the attack parameter of the virtual shooting prop;
[0164] When the fourth detection result of the fourth collision detection ray indicates that a third type of virtual object is detected before the first virtual object in the emission direction, an interference mark is displayed, wherein the interference mark is used to indicate that when the virtual shooting prop has locked the first virtual object as the virtual object to be attacked, the attack operation performed by the virtual shooting prop will be interfered with.
[0165] As an optional solution, the device is used to emit a second collision detection ray in the emission direction in the following manner:
[0166] A second collision detection ray is emitted in the emission direction, wherein the second collision detection ray is configured to, when the second collision detection ray collides with a preset second type of virtual object, provide feedback for indicating a detection result of detecting the second type of virtual object, otherwise, provide feedback for indicating a detection result of not detecting the second type of virtual object.
[0167] As an optional solution, the device is also used to:
[0168] Before emitting a second collision detection ray in the emission direction, obtaining a second type set for the virtual shooting prop;
[0169] According to the second type, the second collision detection ray to be emitted is configured so that when the second collision detection ray collides with a preset second type of virtual object, feedback is used to indicate a detection result of detecting the second type of virtual object, otherwise, feedback is used to indicate a detection result of not detecting the second type of virtual object.
[0170] As an optional solution, the device is used to emit a second collision detection ray in the emission direction in the following manner:
[0171] A second collision detection ray is emitted in the emission direction, wherein the second collision detection ray is used to detect a virtual object of an obstacle type before the first virtual object in the emission direction, and the second type is an obstacle type.
[0172] As an optional solution, the device is also used to:
[0173] configuring the first type of virtual object as a virtual object located at a first level;
[0174] The first collision detection ray is configured to only allow collision detection with virtual objects located at the first level.
[0175] As an optional solution, the device is also used to:
[0176] configuring the second type of virtual object as a virtual object located at a second level;
[0177] The second collision detection ray is configured to only allow detection of collision with virtual objects located at the second level.
[0178] As an optional solution, the device is also used to:
[0179] configuring the second type of virtual object as a virtual object located at a third level, wherein the third level is greater than the first level;
[0180] The second collision detection ray is configured to allow detection of virtual objects located at a level greater than the first level and less than or equal to the third level.
[0181] According to one aspect of the present application, a computer program product is provided, the computer program product comprising a computer program / instruction, the computer program / instruction comprising a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 1209, and / or installed from a removable medium 1211. When the computer program is executed by the central processor 1201, various functions provided in the embodiments of the present application are executed.
[0182] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0183] Fig.12 The structure block diagram of a computer system for implementing an electronic device according to an embodiment of the present application is schematically shown.
[0184] It should be noted that Fig.12 The computer system 1200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0185] like Fig.12 As shown, the computer system 1200 includes a central processing unit 1201 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 1202 (ROM) or the program loaded from the storage part 1208 to the random access memory 1203 (RAM). Various programs and data required for system operation are also stored in the random access memory 1203. The central processing unit 1201, the read-only memory 1202 and the random access memory 1203 are connected to each other through a bus 1204. The input / output interface 1205 (Input / Output interface, i.e., I / O interface) is also connected to the bus 1204.
[0186] The following components are connected to the input / output interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1120 is also connected to the input / output interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1120 as needed so that a computer program read therefrom is installed into the storage section 1208 as needed.
[0187] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1209, and / or installed from the removable medium 1211. When the computer program is executed by the central processor 1201, various functions defined in the system of the present application are executed.
[0188] According to another aspect of the embodiment of the present invention, an electronic device for implementing the above-mentioned virtual prop control method is also provided. The electronic device may be Figure 1 The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a terminal device as an example. Fig.13As shown, the electronic device includes a memory 1302 and a processor 1304. The memory 1302 stores a computer program, and the processor 1304 is configured to execute the steps in any of the above method embodiments through the computer program.
[0189] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0190] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0191] S1, displaying a virtual game scene where a first virtual character is located, wherein the first virtual character is currently using a virtual shooting prop;
[0192] S2, emitting a first collision detection ray in the emission direction of the virtual shooting prop, wherein the first collision detection ray is used to detect a first type of virtual object in the emission direction, and the first type of virtual object is a virtual object that allows the virtual shooting prop to perform an attack operation;
[0193] S3, when the first detection result of the first collision detection ray indicates that a first virtual object of the first type is detected in the emission direction, a second collision detection ray is emitted in the emission direction, wherein the second collision detection ray is used to detect a second type of virtual object before the first virtual object in the emission direction, and the second type of virtual object is used to block the virtual shooting prop from performing an attack operation on the first virtual object;
[0194] S4. When the second detection result of the second collision detection ray indicates that no virtual object of the second type is detected before the first virtual object in the emission direction, a locking success mark is displayed, wherein the locking success mark is used to indicate that the virtual shooting prop has locked the first virtual object as the virtual object for the attack operation to be performed.
[0195] Alternatively, a person skilled in the art may understand that: Fig.13 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, and other terminal devices. Fig.13 The electronic device and the electronic equipment described above are not limited in structure. Fig.13 More or fewer components (such as network interfaces, etc.) as shown in, or with Fig.13 Different configurations are shown.
[0196] Among them, the memory 1302 can be used to store software programs and modules, such as the program instructions / modules corresponding to the control method and device of the virtual props in the embodiment of the present invention. The processor 1304 executes various functional applications and data processing by running the software programs and modules stored in the memory 1302, that is, realizing the control method of the virtual props mentioned above. The memory 1302 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1302 may further include a memory remotely arranged relative to the processor 1304, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 1302 can be specifically, but not limited to, used to store information such as virtual game resources. As an example, such as Fig.13 As shown, the memory 1302 may include, but is not limited to, the first display module 1102, the first transmitting module 1104, the second transmitting module 1106, and the second display module 1108 in the control device of the virtual props. In addition, other module units in the control device of the virtual props may also be included but are not limited to, which will not be repeated in this example.
[0197] Optionally, the transmission device 1306 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 1306 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 1306 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0198] In addition, the electronic device further includes: a display 1308 for displaying the game screen; and a connection bus 1310 for connecting various module components in the electronic device.
[0199] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. Among them, the nodes may form a peer-to-peer (P2P, Peer To Peer) network, and any form of computing device, such as a server, terminal and other electronic devices, may become a node in the blockchain system by joining the peer-to-peer network.
[0200] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the virtual prop control method provided in various optional implementations of the above-mentioned virtual prop control aspects.
[0201] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0202] S1, displaying a virtual game scene where a first virtual character is located, wherein the first virtual character is currently using a virtual shooting prop;
[0203] S2, emitting a first collision detection ray in the emission direction of the virtual shooting prop, wherein the first collision detection ray is used to detect a first type of virtual object in the emission direction, and the first type of virtual object is a virtual object that allows the virtual shooting prop to perform an attack operation;
[0204] S3, when the first detection result of the first collision detection ray indicates that a first virtual object of the first type is detected in the emission direction, a second collision detection ray is emitted in the emission direction, wherein the second collision detection ray is used to detect a second type of virtual object before the first virtual object in the emission direction, and the second type of virtual object is used to block the virtual shooting prop from performing an attack operation on the first virtual object;
[0205] S4. When the second detection result of the second collision detection ray indicates that no virtual object of the second type is detected before the first virtual object in the emission direction, a locking success mark is displayed, wherein the locking success mark is used to indicate that the virtual shooting prop has locked the first virtual object as the virtual object for the attack operation to be performed.
[0206] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0207] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0208] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
[0209] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0210] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0211] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple 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.
[0212] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0213] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for controlling a virtual prop, characterized in that: Applied in target gaming applications, including: Displaying a virtual game scene where a first virtual character is located, wherein the first virtual character is currently using a virtual shooting prop; Launching a first collision detection ray in the launch direction of the virtual shooting prop, wherein the first collision detection ray is used to detect a first type of virtual object in the launch direction, and the first type of virtual object is a virtual object that allows the virtual shooting prop to perform an attack operation; In a case where the first detection result of the first collision detection ray indicates that a first virtual object of the first type is detected in the emission direction, a second collision detection ray is emitted in the emission direction, wherein the second collision detection ray is used to detect a second type of virtual object before the first virtual object in the emission direction, and the second type of virtual object is used to block the virtual shooting prop from performing an attack operation on the first virtual object; When the second detection result of the second collision detection ray indicates that the second type of virtual object is not detected before the first virtual object in the emission direction, a locking success mark is displayed, wherein the locking success mark is used to indicate that the virtual shooting prop has locked the first virtual object as the virtual object to be attacked; The method also includes: configuring the first type of virtual object as a virtual object located at a first level; configuring the first collision detection ray to only allow detection of whether a collision occurs with a virtual object located at the first level; configuring the second type of virtual object as a virtual object located at a second level; and configuring the second collision detection ray to only allow detection of whether a collision occurs with a virtual object located at the second level.
2. The method according to claim 1, characterized in that The method further includes: in a case where the first detection result of the first collision detection ray indicates that a first virtual object of the first type is detected in the emission direction, emitting a third collision detection ray in the emission direction, wherein the third collision detection ray is used to detect a first collided virtual object in the emission direction; The transmitting of the second collision detection ray in the transmitting direction includes: when a third detection result of the third collision detection ray indicates that a first collided third virtual object is detected in the transmitting direction and the third virtual object is not a virtual object of the second type, transmitting the second collision detection ray in the transmitting direction, wherein the second collision detection ray is used to detect the second type of virtual object between the first virtual object and the third virtual object in the transmitting direction.
3. The method according to claim 2, characterized in that When a third detection result of the third collision detection ray indicates that a first collided third virtual object is detected in the emission direction, and the third virtual object is not a virtual object of the second type, emitting the second collision detection ray in the emission direction, comprising: When a third detection result of the third collision detection ray indicates that a first collided third virtual object is detected in the emission direction, and the third virtual object is not a virtual object of the second type, determining a target position of the third virtual object in the emission direction; The second collision detection ray is emitted in the emission direction, wherein the second collision detection ray is configured to detect the second type of virtual object starting from the target position.
4. The method according to claim 1, characterized in that The method further comprises: When the second detection result of the second collision detection ray indicates that a second virtual object of the second type is detected before the first virtual object in the emission direction, a locking failure mark is displayed, wherein the locking failure mark is used to indicate that the virtual shooting prop cannot lock the first virtual object as a virtual object to be attacked.
5. The method according to claim 1, characterized in that The method further comprises: In the case where the virtual shooting prop is configured to perform a virtual attack operation along a straight line, the second collision detection ray is emitted in a straight line in the emission direction; or, In a case where the virtual shooting prop is configured to perform a virtual attack operation along a curve, the second collision detection ray is emitted along the curve in the emission direction.
6. The method according to claim 1, characterized in that After displaying the lock success mark, the method further includes: Launching a fourth collision detection ray in the launching direction, wherein the fourth collision detection ray is used to detect a third type of virtual object in the launching direction, and the third type of virtual object is used to reduce an attack parameter of the virtual shooting prop; When the fourth detection result of the fourth collision detection ray indicates that the third type of virtual object is detected before the first virtual object in the emission direction, an interference mark is displayed, wherein the interference mark is used to indicate that when the virtual shooting prop has locked the first virtual object as the virtual object to be attacked, the attack operation performed by the virtual shooting prop will be interfered.
7. The method according to any one of claims 1 to 6, characterized in that The emitting a second collision detection ray in the emitting direction comprises: The second collision detection ray is emitted in the emission direction, wherein the second collision detection ray is configured to, when the second collision detection ray collides with a preset virtual object of the second type, provide feedback for indicating a detection result that the second type of virtual object is detected, otherwise, provide feedback for indicating a detection result that the second type of virtual object is not detected.
8. The method according to claim 7, characterized in that Before emitting the second collision detection ray in the emission direction, the method further includes: Acquire the second type set for the virtual shooting prop; According to the second type, the second collision detection ray to be emitted is configured so that when the second collision detection ray collides with a preset virtual object of the second type, feedback is used to indicate a detection result that the virtual object of the second type is detected; otherwise, feedback is used to indicate a detection result that the virtual object of the second type is not detected.
9. The method according to any one of claims 1 to 6, characterized in that The emitting a second collision detection ray in the emitting direction comprises: The second collision detection ray is emitted in the emission direction, wherein the second collision detection ray is used to detect a virtual object of an obstacle type before the first virtual object in the emission direction, and the second type is the obstacle type.
10. The method according to claim 1, characterized in that The method further comprises: configuring the second type of virtual object as a virtual object located at a third level, wherein the third level is greater than the first level; The second collision detection ray is configured to allow detection of virtual objects located at a level greater than the first level and less than or equal to the third level.
11. A control device for a virtual item, characterized in that: include: A first display module, used to display a virtual game scene where a first virtual character is located, wherein the first virtual character is currently using a virtual shooting prop; A first transmitting module, configured to transmit a first collision detection ray in a transmitting direction of the virtual shooting prop, wherein the first collision detection ray is used to detect a first type of virtual object in the transmitting direction, and the first type of virtual object is a virtual object that allows the virtual shooting prop to perform an attack operation; a second transmitting module, configured to transmit a second collision detection ray in the transmitting direction when a first detection result of the first collision detection ray indicates that a first virtual object of the first type is detected in the transmitting direction, wherein the second collision detection ray is used to detect a second type of virtual object before the first virtual object in the transmitting direction, the second type of virtual object is used to block the virtual shooting prop from performing an attack operation on the first virtual object, and the first type of virtual object and the second type of virtual object are respectively at different levels; A second display module is configured to display a locking success mark when the second detection result of the second collision detection ray indicates that the second type of virtual object is not detected before the first virtual object in the emission direction, wherein the locking success mark is used to indicate that the virtual shooting prop has locked the first virtual object as the virtual object to be attacked; The device is also used to: configure the first type of virtual object as a virtual object located at a first level; configure the first collision detection ray to only allow detection of whether a collision occurs with a virtual object located at the first level; configure the second type of virtual object as a virtual object located at a second level; and configure the second collision detection ray to only allow detection of whether a collision occurs with a virtual object located at the second level.
12. The device according to claim 11, characterized in that The device is also used for: In a case where the first detection result of the first collision detection ray indicates that a first virtual object of the first type is detected in the emission direction, a third collision detection ray is emitted in the emission direction, wherein the third collision detection ray is used to detect a first collided virtual object in the emission direction; The device is used to emit a second collision detection ray in the emission direction in the following manner: when a third detection result of the third collision detection ray indicates that a first collided third virtual object is detected in the emission direction and the third virtual object is not a virtual object of the second type, the second collision detection ray is emitted in the emission direction, wherein the second collision detection ray is used to detect the second type of virtual object between the first virtual object and the third virtual object in the emission direction.
13. The device according to claim 12, characterized in that The device is used to launch the second collision detection ray in the emission direction when the third detection result of the third collision detection ray indicates that the first collided third virtual object is detected in the emission direction and the third virtual object is not the second type of virtual object in the emission direction in the following manner: When a third detection result of the third collision detection ray indicates that a first collided third virtual object is detected in the emission direction, and the third virtual object is not a virtual object of the second type, determining a target position of the third virtual object in the emission direction; The second collision detection ray is emitted in the emission direction, wherein the second collision detection ray is configured to detect the second type of virtual object starting from the target position.
14. The device according to claim 11, characterized in that The device is also used for: When the second detection result of the second collision detection ray indicates that a second virtual object of the second type is detected before the first virtual object in the emission direction, a locking failure mark is displayed, wherein the locking failure mark is used to indicate that the virtual shooting prop cannot lock the first virtual object as a virtual object to be attacked.
15. The device according to claim 11, characterized in that The device is also used for: In a case where the virtual shooting prop is configured to perform a virtual attack operation along a straight line, emitting the second collision detection ray along a straight line in the emission direction; or, In a case where the virtual shooting prop is configured to perform a virtual attack operation along a curve, the second collision detection ray is emitted along the curve in the emission direction.
16. The device according to claim 11, characterized in that After displaying the locking success mark, the device is further used for: Launching a fourth collision detection ray in the launching direction, wherein the fourth collision detection ray is used to detect a third type of virtual object in the launching direction, and the third type of virtual object is used to reduce an attack parameter of the virtual shooting prop; When the fourth detection result of the fourth collision detection ray indicates that the third type of virtual object is detected before the first virtual object in the emission direction, an interference mark is displayed, wherein the interference mark is used to indicate that when the virtual shooting prop has locked the first virtual object as the virtual object to be attacked, the attack operation performed by the virtual shooting prop will be interfered.
17. The device according to any one of claims 11 to 16, characterized in that The device is used to emit a second collision detection ray in the emission direction in the following manner: The second collision detection ray is emitted in the emission direction, wherein the second collision detection ray is configured to, when the second collision detection ray collides with a preset virtual object of the second type, provide feedback for indicating a detection result that the second type of virtual object is detected, otherwise, provide feedback for indicating a detection result that the second type of virtual object is not detected.
18. The device according to any one of claims 17, characterized in that The device is also used for: Before emitting the second collision detection ray in the emission direction, acquiring the second type set for the virtual shooting prop; According to the second type, the second collision detection ray to be emitted is configured so that when the second collision detection ray collides with a preset virtual object of the second type, feedback is used to indicate a detection result that the virtual object of the second type is detected; otherwise, feedback is used to indicate a detection result that the virtual object of the second type is not detected.
19. The device according to any one of claims 11 to 16, characterized in that The device is used to emit a second collision detection ray in the emission direction in the following manner: The second collision detection ray is emitted in the emission direction, wherein the second collision detection ray is used to detect a virtual object of an obstacle type before the first virtual object in the emission direction, and the second type is the obstacle type.
20. The device according to claim 11, characterized in that The device is also used for: configuring the second type of virtual object as a virtual object located at a third level, wherein the third level is greater than the first level; The second collision detection ray is configured to allow detection of virtual objects located at a level greater than the first level and less than or equal to the third level.
21. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program can be executed by a terminal device or a computer to execute the method described in any one of claims 1 to 10.
22. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method described in any one of claims 1 to 10 are implemented.
23. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 10 through the computer program.
