Method, device, storage medium and electronic device for controlling movement of virtual character

By responding to displacement control operations in the game, detecting the blocking area and adjusting the displacement target position, the problem of blocking scene affecting the release of displacement skills is solved, and the game player's operation experience and fault tolerance of displacement skills is improved.

CN114832371BActive Publication Date: 2024-12-20NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202210361756.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-07
Publication Date
2024-12-20
Estimated Expiration
2042-04-07

AI Technical Summary

Technical Problem

In the prior art, the blocking scene in the game scene affects the displacement skill release effect, resulting in poor operation experience of gamers and no effective solution.

Method used

The terminal device provides a graphical user interface, responds to the operation of the displacement control, determines the target position of the virtual character in the game scene, detects whether it is located in the blocking area, obtains the candidate sampling position, adjusts the displacement target position to avoid the blocking, and realizes the displacement of the virtual character.

Benefits of technology

It enriches the logic of the displacement skill release, improves the fault tolerance rate and gamer operation experience in the judgment of actual displacement target position.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114832371B_ABST
    Figure CN114832371B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, storage medium and electronic device for controlling the movement of a virtual character. The method comprises: responding to a touch operation performed on a displacement control, determining a first target position of a virtual character in a game scene, wherein the first target position is an original displacement target position determined by a displacement skill attribute corresponding to the displacement control; detecting whether the first target position is located in a blocking area, wherein the blocking area is an area occupied by a virtual blocking object in the game scene; in response to the first target position being located in the blocking area, obtaining a plurality of candidate sampling positions based on the first target position; determining a second target position using the plurality of candidate sampling positions; and controlling the virtual character to move to the second target position. The present invention solves the technical problems of a processing method for adjusting the release logic of a displacement skill for a blocking scene provided in the related art, which has simple logic, low fault tolerance and poor game player operation experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to a method, device, storage medium and electronic device for controlling the movement of a virtual character. Background Art

[0002] In game scenes, displacement skills are usually designed to increase the variety of virtual character movement methods. However, when game players use displacement skills, blocking scenes in the game scene will affect the release effect of the displacement skills, thereby affecting the game player's operating experience. In this regard, technicians in this field continue to try various release logics of displacement skills in order to improve the adaptability of displacement skills to blocking scenes.

[0003] In the related art, when the displacement target position in the game scene is within the blocking scene, the method for determining the actual displacement target position is: taking the first intersection of the line from the displacement origin to the displacement target position and the boundary of the blocking scene as the actual displacement target position; or adding multiple sampling positions on the extension line of the original displacement direction to further determine the actual displacement target position. However, the defects of this method are: the logic of releasing displacement skills is simple, the error tolerance of judging the actual displacement target position is low, and the game player's operation experience is poor.

[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, device, storage medium and electronic device for controlling the movement of a virtual character, so as to at least solve the technical problems of the processing method provided in the related art for adjusting the logic of releasing displacement skills for blocking scenes, which has simple logic, low fault tolerance and poor operating experience for game players.

[0006] According to one aspect of an embodiment of the present invention, a method for controlling the movement of a virtual character is provided, wherein a graphical user interface is provided by a terminal device, and the content displayed by the graphical user interface includes at least a displacement control. The method for controlling the movement of a virtual character includes:

[0007] In response to a touch operation performed on a displacement control, a first target position of a virtual character in a game scene is determined, wherein the first target position is an original displacement target position determined by a displacement skill attribute corresponding to the displacement control; detecting whether the first target position is located in a blocking area, wherein the blocking area is an area occupied by a virtual blocking object in the game scene; in response to the first target position being located in the blocking area, obtaining a plurality of candidate sampling positions based on the first target position; determining a second target position using the plurality of candidate sampling positions; and controlling the virtual character to move to the second target position.

[0008] Optionally, determining the first target position of the virtual character in the game scene includes: obtaining the original position, original orientation and a first distance corresponding to the displacement skill attribute of the virtual character in the game scene, wherein the original position is the displacement origin of the virtual character in the game scene, and the original orientation is the orientation corresponding to the original position of the virtual character; using the original position, original orientation and the first distance, determining the first target position.

[0009] Optionally, obtaining multiple candidate sampling positions based on the first target position includes: determining multiple sampling directions based on the first target position; determining a sampling interval using the first distance; and sampling in each of the multiple sampling directions according to the sampling interval to obtain multiple candidate sampling positions.

[0010] Optionally, using multiple candidate sampling positions, determining the second target position includes: selecting a target sampling position from the multiple candidate sampling positions; and determining the second target position based on the target sampling position.

[0011] Optionally, selecting a target sampling position from multiple candidate sampling positions includes: selecting some candidate sampling positions based on a positional relationship between each candidate sampling position among the multiple candidate sampling positions and the blocking area, wherein some of the candidate sampling positions are outside the blocking area; selecting the target sampling position using a sequence identifier of each candidate sampling position among the partial candidate sampling positions, wherein the sequence identifier is determined by at least one of a second distance and a third distance, the second distance is the distance between each candidate sampling position and a first ray, the first ray is determined by the original position of the virtual character in the game scene and the first target position, and the third distance is the distance between each candidate sampling position and the first target position.

[0012] Optionally, determining the second target position based on the target sampling position includes: emitting a second ray from the original position of the virtual character in the game scene to the target sampling position; determining the position to be used on the second ray based on the original position and a first distance corresponding to the displacement skill attribute; detecting whether the position to be used is located in a blocking area; and in response to the position to be used being outside the blocking area, determining the position to be used as the second target position.

[0013] Optionally, determining the second target position based on the target sampling position includes: emitting a second ray from the original position of the virtual character in the game scene to the target sampling position; determining the position to be used on the second ray based on the original position and a first distance corresponding to the displacement skill attribute; detecting whether the position to be used is located in a blocking area; in response to the position to be used being located in the blocking area, obtaining a first intersection position between a first line and a first blocking boundary of the blocking area, wherein the first line is a line between the position to be used and the target sampling position; and determining the first intersection position as the second target position.

[0014] Optionally, the above method for controlling the movement of a virtual character also includes: in response to multiple candidate sampling positions being located in a blocking area, detecting whether the virtual character moves along a second blocking boundary of the blocking area; in response to the virtual character moving along the second blocking boundary of the blocking area, adjusting the original orientation of the virtual character in the game scene to obtain an adjusted displacement direction; and when the angle between the original orientation and the displacement direction is greater than a preset angle threshold, adjusting the first distance corresponding to the displacement skill attribute to obtain a fourth distance, wherein the fourth distance is less than the first distance; and detecting again whether the first target position is located in the blocking area until the second target position is re-determined based on the adjusted displacement direction and the first distance or the fourth distance.

[0015] Optionally, the above method for controlling the movement of a virtual character also includes: in response to multiple candidate sampling positions being located in a blocking area, detecting whether the virtual character moves along a second blocking boundary of the blocking area; in response to the virtual character not moving along the second blocking boundary of the blocking area, obtaining a second intersection position between a second line and the second blocking boundary, wherein the second line is a line between the original position of the virtual character in the game scene and the first target position; and determining the second intersection position as the second target position.

[0016] According to another aspect of an embodiment of the present invention, a device for controlling the movement of a virtual character is provided. A graphical user interface is provided by a terminal device, and the content displayed by the graphical user interface includes at least a displacement control. The device for controlling the movement of a virtual character includes:

[0017] A first determination module is used to respond to a touch operation performed on a displacement control to determine a first target position of a virtual character in a game scene, wherein the first target position is an original displacement target position determined by a displacement skill attribute corresponding to the displacement control; a detection module is used to detect whether the first target position is located in a blocking area, wherein the blocking area is an area occupied by a virtual obstacle in the game scene; an acquisition module is used to respond to the first target position being located in the blocking area and acquire multiple candidate sampling positions based on the first target position; a second determination module is used to determine a second target position using multiple candidate sampling positions; and a control module is used to control the virtual character to move to the second target position.

[0018] Optionally, the first determination module is also used to: obtain the original position, original orientation and a first distance corresponding to the displacement skill attribute of the virtual character in the game scene, wherein the original position is the displacement origin of the virtual character in the game scene, and the original orientation is the orientation corresponding to the original position of the virtual character; and determine the first target position using the original position, original orientation and the first distance.

[0019] Optionally, the acquisition module is further used to: determine multiple sampling directions based on the first target position; determine the sampling interval using the first distance; and perform sampling in each of the multiple sampling directions according to the sampling interval to obtain multiple candidate sampling positions.

[0020] Optionally, the second determination module is further used to: select a target sampling position from multiple candidate sampling positions; and determine a second target position based on the target sampling position.

[0021] Optionally, the second determination module is further used to: select some candidate sampling positions based on the positional relationship between each candidate sampling position among multiple candidate sampling positions and the blocking area, wherein some candidate sampling positions are outside the blocking area; select the target sampling position using the sequence identifier of each candidate sampling position among the some candidate sampling positions, wherein the sequence identifier is determined by at least one of the second distance and the third distance, the second distance is the distance between each candidate sampling position and the first ray, the first ray is determined by the original position of the virtual character in the game scene and the first target position, and the third distance is the distance between each candidate sampling position and the first target position.

[0022] Optionally, the second determination module is also used to: emit a second ray from the original position of the virtual character in the game scene to the target sampling position; determine the position to be used on the second ray based on the original position and the first distance corresponding to the displacement skill attribute; detect whether the position to be used is located in a blocking area; in response to the position to be used being outside the blocking area, determine the position to be used as the second target position.

[0023] Optionally, the second determination module is also used to: emit a second ray from the original position of the virtual character in the game scene to the target sampling position; determine the position to be used on the second ray based on the original position and the first distance corresponding to the displacement skill attribute; detect whether the position to be used is located in the blocking area; in response to the position to be used being located in the blocking area, obtain the first intersection position between the first line and the first blocking boundary of the blocking area, wherein the first line is the line between the position to be used and the target sampling position; and determine the first intersection position as the second target position.

[0024] Optionally, the device for controlling the movement of a virtual character further includes: a first adjustment module, for detecting whether the virtual character moves along a second blocking boundary of the blocking area in response to multiple candidate sampling positions being located in the blocking area; in response to the virtual character moving along the second blocking boundary of the blocking area, adjusting the original orientation of the virtual character in the game scene to obtain an adjusted displacement direction; and when the angle between the original orientation and the displacement direction is greater than a preset angle threshold, adjusting the first distance corresponding to the displacement skill attribute to obtain a fourth distance, wherein the fourth distance is less than the first distance; and detecting again whether the first target position is located in the blocking area until the second target position is re-determined based on the adjusted displacement direction and the first distance or the fourth distance.

[0025] Optionally, the device for controlling the movement of a virtual character further includes: a second adjustment module, for detecting whether the virtual character moves along a second blocking boundary of the blocking area in response to a plurality of candidate sampling positions being located in the blocking area; in response to the virtual character not moving along the second blocking boundary of the blocking area, obtaining a second intersection position between a second line and the second blocking boundary, wherein the second line is a line between the original position of the virtual character in the game scene and the first target position; and determining the second intersection position as the second target position.

[0026] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute any of the above methods for controlling the movement of a virtual character when running.

[0027] According to another aspect of an embodiment of the present invention, an electronic device is provided, comprising: a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any of the above methods for controlling the movement of a virtual character.

[0028] In at least some embodiments of the present invention, a touch operation performed on a displacement control is responded to to determine a first target position of a virtual character in a game scene, the first target position being an original displacement target position determined by a displacement skill attribute corresponding to the displacement control. By detecting whether the first target position is located in a blocking area, which is an area occupied by a virtual obstacle in the game scene, and then in response to the first target position being located in the blocking area, a plurality of candidate sampling positions are obtained based on the first target position, and a second target position is determined using the plurality of candidate sampling positions and the virtual character is controlled to be displaced to the second target position, thereby achieving the purpose of adjusting the displacement skill release logic in the game scene to adapt to the blocking scene, thereby achieving the technical effect of enriching the displacement skill release logic, improving the fault tolerance of the actual displacement target position judgment and the game player operation experience, and further solving the technical problems of the processing method for adjusting the displacement skill release logic for the blocking scene provided in the related art, which has simple logic, low fault tolerance and poor game player operation experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. 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:

[0030] Figure 1 It is a hardware structure block diagram of a mobile terminal of a method for controlling movement of a virtual character according to an embodiment of the present invention;

[0031] Figure 2 is a flow chart of a method for controlling movement of a virtual character according to one embodiment of the present invention;

[0032] Figure 3 is a schematic diagram of determining candidate sampling positions in a process of controlling movement of a virtual character according to one optional embodiment of the present invention;

[0033] Figure 4 is a schematic diagram of selecting a target sampling position in a process of controlling movement of a virtual character according to one optional embodiment of the present invention;

[0034] Figure 5 is a schematic diagram of adjusting a displacement target position in a process of controlling movement of a virtual character according to one optional embodiment of the present invention;

[0035] Figure 6 is a schematic diagram of adjusting a displacement target position in a process of controlling movement of a virtual character according to another optional embodiment of the present invention;

[0036] Figure 7 is a schematic diagram of adjusting a displacement target position when a virtual character moves along a blocking boundary according to one optional embodiment of the present invention;

[0037] Figure 8 is a schematic diagram of adjusting the displacement target position when the virtual character does not move along the blocking boundary according to one optional embodiment of the present invention;

[0038] Fig. 9 is a structural block diagram of a device for controlling movement of a virtual character according to one embodiment of the present invention;

[0039] Fig.10 is a structural block diagram of an apparatus for controlling movement of a virtual character according to one optional embodiment of the present invention;

[0040] Fig.11 It is a structural block diagram of an apparatus for controlling the movement of a virtual character according to another optional embodiment of the present invention. DETAILED DESCRIPTION

[0041] 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.

[0042] 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.

[0043] According to one embodiment of the present invention, an embodiment of a method for controlling the movement of a virtual character is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0044] In one embodiment of the present invention, the method for controlling the movement of a virtual character can be run on a terminal device or a server. The terminal device can be a local terminal device. When the method for controlling the movement of a virtual character is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.

[0045] In an optional implementation, various cloud applications, such as cloud games, can be run under the cloud interaction system. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the operation mode of cloud games, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the method for controlling the movement of virtual characters are completed on the cloud game server. The role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the terminal device for information processing is a cloud game server in the cloud. When playing the game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.

[0046] In an optional embodiment, the terminal device may be a local terminal device. Taking a game as an example, the local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the player through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.

[0047] In a possible implementation, an embodiment of the present invention provides a method for controlling the movement of a virtual character, providing a graphical user interface through a terminal device, wherein the terminal device can be the local terminal device mentioned above, or can be a client device in the cloud interaction system mentioned above.

[0048] Taking a mobile terminal running in a local terminal device as an example, the mobile terminal can be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, referred to as MID), a PAD, a game console, and other terminal devices. Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a method for controlling movement of a virtual character according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microprocessor (MCU), a programmable logic device (FPGA), a neural network processor (NPU), a tensor processor (TPU), an artificial intelligence (AI) type processor, etc.) and a memory 104 for storing data. Optionally, the mobile terminal may also include a transmission device 106 for communication functions, an input and output device 108, and a display device 110. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0049] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for controlling the movement of a virtual character in an embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the method for controlling the movement of the virtual character described above is realized. The memory 104 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 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0050] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0051] The inputs in the input / output device 108 may come from a plurality of human interface devices (HIDs), such as keyboards and mice, game controllers, and other dedicated game controllers (such as steering wheels, fishing rods, dance mats, remote controls, etc.). In addition to providing input functions, some human interface devices may also provide output functions, such as force feedback and vibration of game controllers, audio output of controllers, etc.

[0052] The display device 110 may be, for example, a head-up display (HUD), a touch-screen liquid crystal display (LCD), and a touch display (also referred to as a "touch screen" or "touch display screen"). The liquid crystal display may enable a user to interact with a user interface of the mobile terminal. In some embodiments, the mobile terminal has a graphical user interface (GUI), and a user may interact with the GUI by finger contacts and / or gestures on a touch-sensitive surface, wherein the human-computer interaction functions here may optionally include the following interactions: creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving emails, call interfaces, playing digital videos, playing digital music, and / or web browsing, etc. The executable instructions for executing the above-mentioned human-computer interaction functions are configured / stored in a computer program product or a readable storage medium executable by one or more processors.

[0053] In this embodiment, a method for controlling the movement of a virtual character running on the mobile terminal is provided. A graphical user interface is provided by the mobile terminal device. The content displayed by the graphical user interface includes at least a displacement control. Figure 2 is a flow chart of a method for controlling the movement of a virtual character according to one embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:

[0054] Step S202, in response to the touch operation performed on the displacement control, determining a first target position of the virtual character in the game scene, wherein the first target position is an original displacement target position determined by the displacement skill attribute corresponding to the displacement control;

[0055] The mobile terminal device may provide a graphical user interface, and the content displayed by the graphical user interface includes at least a displacement control. The displacement control may receive a touch operation, and the mobile terminal device may respond to the touch operation performed on the displacement control. For example, the mobile terminal device may be a smart phone, and the touch screen of the smart phone displays the graphical user interface, and the graphical user interface may include a game scene and a displacement skill button, and the displacement skill button is used to support game players to control the virtual character to release the corresponding displacement skill through touch operation.

[0056] The first target position may be an original displacement target position determined by the displacement skill attribute, wherein the displacement skill corresponds to the displacement control displayed in the graphical user interface. The displacement skill attribute may include: displacement direction, displacement distance, skill characteristics (e.g., whether it can pass through a wall, whether it can knock down enemy units on the displacement path, etc.). The original displacement target position is the displacement target position of the virtual character assuming that the displacement skill is released without passing through a blocking area. By responding to the touch operation performed on the displacement control, the first target position of the virtual character in the game scene may be determined.

[0057] Taking a multiplayer online battle arena (MOBA) game running on a smart phone as an example, a flash displacement skill button may be provided on the graphical user interface of the MOBA game, and the flash displacement skill button may receive a touch operation in a corresponding area of ​​the touch screen of the smart phone, and is used to control the release of the corresponding flash displacement skill. Under the default situation (i.e., without considering the influence of the blocking area in the game scene), when a touch operation of the flash displacement skill button by a game player is received, the virtual character is displaced to the displacement target position determined by the flash displacement skill attribute in the game scene (equivalent to the above-mentioned first target position, i.e., the original displacement target position).

[0058] Step S204, detecting whether the first target position is located in a blocking area, wherein the blocking area is an area occupied by a virtual blocking object in the game scene;

[0059] In virtual game design, in order to increase the richness and diversity of game scenes, many virtual obstacles of different sizes and shapes are usually placed in the game scenes, such as: rock walls, buildings, trees, other characters or units, etc. In the game scene, the area occupied by virtual obstacles is called the blocking area, and the virtual character usually cannot pass through or stay in the above-mentioned blocking area. When the above-mentioned first target position is located in the blocking area, the first target position should be adjusted to improve the game player's operating experience. Therefore, in response to the touch operation performed on the displacement control, after determining the first target position of the virtual character in the game scene, it is necessary to detect whether the first target position is located in the blocking area to determine the actual displacement effect of the virtual character.

[0060] Still taking the MOBA game running on a smartphone as an example, the game scene is usually full of virtual obstacles (for example: terrain walls, map boundaries, base buildings, defense towers, terrain decorations, etc.). In order to enhance virtual reality and game experience, the virtual character cannot "overlap" with these virtual obstacles. Therefore, when the game player controls the virtual character to release the flash displacement skill in the game scene, the impact of these virtual obstacles needs to be considered. In other words, when the displacement target position determined by the flash displacement skill attribute (equivalent to the above-mentioned first target position, that is, the original displacement target position) is located in the blocking area occupied by the virtual obstacle, the displacement target position needs to be adjusted to complete the release of the flash displacement skill. Furthermore, every time the player uses the flash displacement skill, it is necessary to detect whether the displacement target position determined by the flash displacement skill attribute is located in the blocking area.

[0061] Step S206, in response to the first target position being located in the blocking area, acquiring a plurality of candidate sampling positions based on the first target position;

[0062] The first target position may be an original displacement target position determined by the displacement skill attribute, wherein the displacement skill attribute corresponds to the displacement control displayed in the graphical user interface. When the first target position is detected to be located in the blocking area, the plurality of candidate sampling positions may be obtained based on the first target position. The plurality of candidate sampling positions may be used to determine the actual displacement effect of the virtual character.

[0063] Still taking the MOBA game running on smartphone as an example, Figure 3 is a schematic diagram of determining candidate sampling positions in the process of controlling the movement of a virtual character according to one optional embodiment of the present invention, such as Figure 3As shown, the game player controls the virtual character to release the flash displacement skill from the displacement origin O in the game scene toward the position Q, and the position Q is the displacement target position determined by the attributes of the flash displacement skill (equivalent to the first target position, i.e., the original displacement target position). When it is detected that the original displacement target position Q is located in the above-mentioned blocking area, ten candidate sampling positions nearby are determined based on the original displacement target position Q, which are recorded as c1 to c10, and are used to determine the actual release effect of the flash displacement skill.

[0064] Step S208, using multiple candidate sampling positions to determine a second target position;

[0065] The plurality of candidate sampling positions may be obtained based on the first target position when the first target position is located in the blocking area. The second target position may be determined using the plurality of candidate sampling positions. The second target position may be used to determine the actual displacement effect of the virtual character.

[0066] Still taking the MOBA game running on smartphone as an example, Figure 3 As shown, when it is detected that the original displacement target position Q is located in the above-mentioned blocking area, based on the above-mentioned ten candidate sampling position points c1~c10, the actual displacement target position T (equivalent to the above-mentioned second target position, not drawn in the figure) determined by the above-mentioned flash displacement skill attributes can be determined.

[0067] Step S210, controlling the virtual character to move to a second target position.

[0068] In the game scene, since the first target position (ie, the original displacement target position) is located in the blocking area, the second target position can be obtained by adjusting the first target position, that is, the final displacement target position of the virtual character.

[0069] Still taking the MOBA game running on a smartphone as an example, when the game player controls the virtual character to release the flash displacement skill in the game scene, first, the influence of the virtual obstacles in the game scene is considered. By determining multiple candidate sampling positions, the adjusted displacement target position (equivalent to the above-mentioned second target position) can be determined, and then the virtual character is controlled to move to the adjusted displacement target position to complete the release of the flash displacement skill.

[0070] Through the above steps, a first target position of a virtual character in a game scene can be determined in response to a touch operation performed on a displacement control, wherein the first target position is an original displacement target position determined by a displacement skill attribute corresponding to the displacement control, and by detecting whether the first target position is located in a blocking area, which is an area occupied by a virtual obstacle in the game scene, and then in response to the first target position being located in the blocking area, a plurality of candidate sampling positions are obtained based on the first target position, and a second target position is determined by using the plurality of candidate sampling positions and the virtual character is controlled to be displaced to the second target position, thereby achieving the purpose of adjusting the displacement skill release logic in the game scene to adapt to the blocking scene, thereby achieving the technical effect of enriching the displacement skill release logic, improving the fault tolerance rate of the actual displacement target position judgment and the game player operation experience, and further solving the technical problems of the processing method for adjusting the displacement skill release logic for the blocking scene provided in the related art, which has simple logic, low fault tolerance rate and poor game player operation experience.

[0071] Optionally, in step S202, determining the first target position of the virtual character in the game scene may include the following execution steps:

[0072] Step S221, obtaining the original position, original orientation, and first distance corresponding to the displacement skill attribute of the virtual character in the game scene, wherein the original position is the displacement origin of the virtual character in the game scene, and the original orientation is the orientation corresponding to the original position of the virtual character;

[0073] Step S222: Determine the first target position using the original position, the original orientation and the first distance.

[0074] The above-mentioned original position may be the current position of the virtual character when releasing the displacement skill in the game scene, that is, the above-mentioned displacement origin. The above-mentioned original orientation may be the orientation corresponding to the virtual character at the original position. The above-mentioned displacement skill attributes may include: displacement direction, displacement distance, skill characteristics (for example, whether it can pass through walls, whether to knock away enemy units on the displacement path, etc.), etc. Based on the original position, the original orientation and the displacement skill attribute of the virtual character in the game scene, the first distance corresponding to the virtual character in the game scene can be obtained, and the first distance may be the original displacement distance corresponding to the displacement skill attribute.

[0075] The first target position may be an original displacement target position determined by the displacement skill attribute, wherein the displacement skill attribute corresponds to the displacement control displayed in the graphical user interface. The first target position may be determined based on the original position, the original orientation and the first distance.

[0076] Still taking the MOBA game running on smartphone as an example, Figure 3As shown, the displacement origin O is the original position of the virtual character in the game scene; the direction from the displacement origin O to the position Q is the original orientation; the distance from the displacement origin O to the position Q is the original displacement distance corresponding to the displacement skill attribute (equivalent to the first distance), recorded as D1. When the game player controls the virtual character to release the flash displacement skill in the direction of the displacement origin O in the game scene toward the position Q, the position Q can be determined to be the first target position (i.e., the original displacement target position).

[0077] Optionally, in step S206, acquiring multiple candidate sampling positions based on the first target position may include the following execution steps:

[0078] Step S261, determining multiple sampling directions based on the first target position;

[0079] Step S262, using the first distance to determine a sampling interval;

[0080] Step S263: Sampling is performed in each of the multiple sampling directions according to the sampling interval to obtain multiple candidate sampling positions.

[0081] The first target position may be an original displacement target position determined by the displacement skill attribute, wherein the displacement skill attribute corresponds to the displacement control displayed in the graphical user interface. Based on the first target position, a plurality of sampling directions may be determined, and the sampling directions are used to determine the plurality of candidate sampling positions.

[0082] The first distance may be an original displacement distance determined by the displacement skill attribute. Based on the first distance, the sampling interval may be determined. The sampling interval may be a distance between two adjacent candidate sampling positions among the plurality of candidate sampling positions, which is used to determine the plurality of candidate sampling positions.

[0083] Based on the first target position, sampling may be performed in each of the multiple sampling directions according to the sampling interval, so as to obtain the multiple candidate sampling positions.

[0084] Still taking the MOBA game running on smartphone as an example, Figure 3As shown, position Q is the original displacement target (equivalent to the above-mentioned first target position). When it is detected that the original displacement target position Q is located in the above-mentioned blocking area, the five sampling directions shown in the figure can be determined based on the original displacement target position Q. According to the original displacement distance D1 (equivalent to the above-mentioned first distance) corresponding to the flash displacement skill attribute, the sampling interval D=D1×b is determined, where b is the sampling coefficient, which can be preset to a fixed value between 0.05 and 0.2 according to the actual application scenario. In each of the above-mentioned five sampling directions, sampling is performed according to the sampling interval D, and the ten candidate sampling positions c1~c10 in the figure can be obtained. It should be noted that, among the eleven positions of the above-mentioned ten candidate sampling positions c1~c10 and position Q, the distance between any two adjacent positions connected by dotted lines is the above-mentioned sampling interval D.

[0085] Optionally, in step S208, using multiple candidate sampling positions to determine the second target position may include the following execution steps:

[0086] Step S281, selecting a target sampling position from a plurality of candidate sampling positions;

[0087] Step S282: determine a second target position based on the target sampling position.

[0088] When the first target position is detected to be located in the blocking area, the plurality of candidate sampling positions are determined based on the first target position, and a target sampling position is selected from the plurality of candidate sampling positions. Based on the target sampling position, the second target position can be determined, and the second target position is used to determine the actual release effect of the displacement skill.

[0089] Optionally, in step S281, selecting a target sampling position from a plurality of candidate sampling positions may include the following execution steps:

[0090] Step S2811, selecting some candidate sampling positions according to the positional relationship between each candidate sampling position among the plurality of candidate sampling positions and the blocking area, wherein some candidate sampling positions are outside the blocking area;

[0091] Step S2812, using the sequential identifier of each candidate sampling position in some candidate sampling positions, select the target sampling position, wherein the sequential identifier is determined by at least one of the second distance and the third distance, the second distance is the distance between each candidate sampling position and the first ray, the first ray is determined by the original position of the virtual character in the game scene and the first target position, and the third distance is the distance between each candidate sampling position and the first target position.

[0092] The above-mentioned part of candidate sampling positions is selected from the multiple candidate sampling positions according to the positional relationship between each candidate sampling position in the multiple candidate sampling positions and the above-mentioned blocking area, wherein the positional relationship may be whether the candidate sampling position is located in the blocking area, and each candidate sampling position in the part of candidate sampling positions is outside the blocking area.

[0093] For each candidate sampling position in the above-mentioned part of candidate sampling positions, its sequence identification can be determined according to at least one of the following two methods: first, the first ray is determined by the original position of the virtual character in the game scene and the first target position, and the sequence identification of the candidate sampling position is determined according to the distance from the candidate sampling position to the first ray (i.e., the above-mentioned second distance); second, the sequence identification of the candidate sampling position is determined by the distance between the candidate sampling position and the first target position (i.e., the above-mentioned third distance). The above-mentioned target sampling position can be selected using the sequence identification of each candidate sampling position in the above-mentioned part of candidate sampling positions.

[0094] Still taking the MOBA game running on smartphone as an example, Figure 4 is a schematic diagram of selecting a target sampling position in the process of controlling the movement of a virtual character according to one optional embodiment of the present invention, such as Figure 4 As shown, some candidate sampling positions outside the blocking area, namely c7, c8, c9 and c10, are selected from the ten candidate sampling positions c1 to c10. The method steps for determining the sequential identification of each candidate sampling position in the part of the candidate sampling positions are as follows:

[0095] In the first step, the direction of the "OQ-c1-c2" ray in the figure is determined to be the first ray, and the distance from each candidate sampling position in some candidate sampling positions (i.e., c7, c8, c9, and c10) to the first ray is calculated respectively, which are recorded as r7, r8, r9, and r10.

[0096] In the second step, the distance from each candidate sampling position in some candidate sampling positions (i.e., c7, c8, c9, and c10) to the original displacement target position Q is calculated respectively, which are recorded as x7, x8, x9, and x10.

[0097] In the third step, the sequential identification of each candidate sampling position in the portion of candidate sampling positions is determined by one of the following three methods:

[0098] (1) determining the order identification of each candidate sampling position from the distances r7, r8, r9 and r10 from each candidate sampling position in the part of candidate sampling positions obtained in the first step to the first ray;

[0099] (2) determining the order identification of each candidate sampling position from the distances x7, x8, x9 and x10 from each candidate sampling position in the part of candidate sampling positions obtained in the second step to the original displacement target position Q;

[0100] (3) The distances r7, r8, r9 and r10 from each candidate sampling position in the part of candidate sampling positions obtained in the first step to the first ray and the distances x7, x8, x9 and x10 from each candidate sampling position in the part of candidate sampling positions obtained in the second step to the original displacement target Q jointly determine the sequential identification of the candidate sampling positions.

[0101] Optionally, in step S282, determining the second target position based on the target sampling position may include the following execution steps:

[0102] Step S2821, sending a second ray from the original position of the virtual character in the game scene to the target sampling position;

[0103] Step S2822, determining the position to be used on the second ray according to the original position and the first distance corresponding to the displacement skill attribute;

[0104] Step S2823, detecting whether the position to be used is located in a blocking area;

[0105] Step S2824: In response to the position to be used being outside the blocking area, the position to be used is determined as the second target position.

[0106] In the game scene, the second ray is emitted from the original position of the virtual character to the target sampling position. The first distance may be the original displacement distance determined by the displacement skill attribute. According to the original position and the first distance corresponding to the displacement skill attribute, the position to be used may be determined on the second ray. The position to be used may be a position on the second ray whose distance from the original position is the first distance.

[0107] Detect whether the position to be used is located in the above-mentioned blocking area. When it is detected that the position to be used is outside the blocking area, the position to be used can be determined as the above-mentioned second target position. The second target position can be the final displacement target position of the displacement skill.

[0108] Still taking the MOBA game running on smartphone as an example, Figure 5 is a schematic diagram of adjusting the displacement target position in the process of controlling the movement of a virtual character according to one optional embodiment of the present invention, such as Figure 5As shown, when the flash displacement skill is used, it is detected that the original displacement target position Q is located in the blocking area 2. Ten candidate sampling positions are still determined based on the original displacement target position Q, and some candidate sampling positions located outside the blocking area 2 are selected from the ten candidate sampling positions. Then, the target sampling position is selected and marked as P using the sequence identifier of each candidate sampling position in the part of the candidate sampling positions.

[0109] Still like Figure 5 As shown, a second ray is emitted from the virtual character's displacement origin O (i.e., the current position when the flash displacement skill is used) to the target sampling position P. The position P1 to be used for the flash displacement skill is determined on the second ray, and the distance from the position P1 to be used to the displacement origin O is equal to the distance from the first target position to the displacement origin O, and both values ​​are the original displacement distance D1 (equivalent to the first distance) determined by the attributes of the flash displacement skill.

[0110] Still like Figure 5 As shown, if it is detected that the position P1 to be used for the flash displacement skill is outside the blocking area 2, the position P1 to be used is determined as the actual displacement target position T of the flash displacement skill (equivalent to the above-mentioned second target position).

[0111] Optionally, in step S282, determining the second target position based on the target sampling position may further include the following execution steps:

[0112] Step S2825, sending a second ray from the original position of the virtual character in the game scene to the target sampling position;

[0113] Step S2826, determining the position to be used on the second ray according to the original position and the first distance corresponding to the displacement skill attribute;

[0114] Step S2827, detecting whether the position to be used is located in a blocking area;

[0115] Step S2828, in response to the position to be used being located in the blocking area, obtaining a first intersection position between a first connecting line and a first blocking boundary of the blocking area, wherein the first connecting line is a connecting line between the position to be used and the target sampling position;

[0116] Step S2829: determine the first intersection position as the second target position.

[0117] In the game scene, the second ray is emitted from the original position of the virtual character to the target sampling position. The first distance may be the original displacement distance determined by the displacement skill attribute. According to the original position and the first distance corresponding to the displacement skill attribute, the position to be used may be determined on the second ray. The position to be used may be a position on the second ray whose distance from the original position is the first distance.

[0118] Detect whether the position to be used is located in the above-mentioned blocking area. When it is detected that the position to be used is located in the blocking area, the above-mentioned second target position is determined by the following method steps: first, the position to be used is connected to the target sampling position, and the connection line is recorded as the first connection line; then, the first intersection position between the first connection line and the above-mentioned first blocking boundary of the blocking area is obtained, wherein the first blocking boundary can be the boundary where the first connection line intersects with the blocking area for the first time starting from the target sampling position, and the first intersection position can be the intersection position where the first connection line intersects with the first blocking boundary for the first time starting from the target sampling position; finally, the first intersection position is determined as the above-mentioned second target position. The second target position can be the final displacement target position of the displacement skill.

[0119] Still taking the MOBA game running on smartphone as an example, Figure 6 FIG. 1 is a schematic diagram of adjusting the displacement target position in the process of controlling the movement of a virtual character according to another optional embodiment of the present invention. Figure 6 As shown, when the flash displacement skill is used, it is detected that the original displacement target position Q is located in the blocking area 1. Ten candidate sampling positions are still determined based on the original displacement target position Q, and some candidate sampling positions located outside the blocking area 1 are selected from the ten candidate sampling positions. Then, the target sampling position is selected and marked as P using the sequence identifier of each candidate sampling position in the part of the candidate sampling positions.

[0120] Still like Figure 6 As shown, a second ray is emitted from the virtual character's displacement origin O (i.e., the current position when the flash displacement skill is used) to the target sampling position P. The position P1 to be used for the flash displacement skill is determined on the second ray, and the distance from the position P1 to be used to the displacement origin O is equal to the distance from the original displacement target position Q to the displacement origin O, and both values ​​are the original displacement distance D1 (equivalent to the first distance) determined by the attributes of the flash displacement skill.

[0121] Still like Figure 6 As shown, if it is detected that the position P1 to be used for the flash displacement skill is located in the blocking area 2, the actual displacement target position T of the flash displacement skill is determined by the following method steps:

[0122] Step (1), determining a first connecting line PP1 from the target sampling position P to the position to be used P1;

[0123] Step (2), determining a first blocking boundary AC, and determining a first intersection position P2 by the first connecting line PP1 and the first blocking boundary AC;

[0124] Step (3), determining the first intersection position P1 as the actual displacement target position T of the flash displacement skill (equivalent to the above-mentioned second target position).

[0125] Optionally, the method for controlling the movement of a virtual character may further include the following execution steps:

[0126] Step S302, in response to the plurality of candidate sampling positions being located in the blocking area, detecting whether the virtual character moves along a second blocking boundary of the blocking area;

[0127] Step S304, in response to the virtual character moving along the second blocking boundary of the blocking area, adjusting the original orientation of the virtual character in the game scene to obtain an adjusted displacement direction; and when the angle between the original orientation and the displacement direction is greater than a preset angle threshold, adjusting the first distance corresponding to the displacement skill attribute to obtain a fourth distance, wherein the fourth distance is less than the first distance;

[0128] Step S306, detecting again whether the first target position is located in the blocking area, until the second target position is re-determined according to the adjusted displacement direction and the first distance or the fourth distance.

[0129] When it is detected that the first target position is located in the blocking area, multiple candidate sampling positions are determined based on the first target position, and each of the multiple candidate sampling positions is detected to be located in the blocking area. When it is detected that each of the multiple candidate sampling positions is located in the blocking area, it is further detected whether the virtual character moves along a second blocking boundary of the blocking area, wherein the second blocking boundary may be a boundary where a line connecting the original position of the virtual character and the first target position intersects the blocking area for the first time starting from the original position.

[0130] When it is detected that the virtual character moves along the second blocking boundary of the blocking area, the original orientation of the virtual character in the game scene is adjusted to obtain an adjusted displacement direction, and the adjusted displacement direction may be: the tangent direction of the virtual character moving along the second blocking boundary at the original position. When the angle between the original orientation and the adjusted displacement direction is greater than a preset angle threshold, the first skill corresponding to the displacement skill attribute is adjusted to obtain a fourth distance, wherein the first distance is the original displacement distance corresponding to the displacement skill, and the fourth distance is the adjusted displacement distance corresponding to the displacement skill when the virtual character moves along the second blocking boundary, and the fourth distance is less than the first distance.

[0131] Similar to the above step S222, the first target position is re-determined according to the original position of the virtual character in the game scene, the adjusted displacement direction and the first distance or the fourth distance. The re-determined first target position is detected again to see whether it is located in the blocking area, and the second target position is re-determined according to the method for controlling the movement of the virtual character provided in this embodiment, and the second target position is the final displacement target position of the virtual character.

[0132] Still taking the MOBA game running on smartphone as an example, Figure 7 is a schematic diagram of adjusting the displacement target position when the virtual character moves along the blocking boundary according to one optional embodiment of the present invention, such as Figure 7 As shown, the game player controls the virtual character to release the flash displacement skill at the displacement origin O in the game scene. When the multiple candidate sampling positions determined by the original displacement target position corresponding to the flash displacement skill are all located in the blocking area 3, it is necessary to detect whether the virtual character moves along a blocking boundary of the blocking area 3. The blocking boundary is the boundary where the line between the displacement origin O and the original target position corresponding to the flash displacement skill intersects the blocking area 3 for the first time starting from the displacement origin O.

[0133] Still like Figure 7 As shown, when it is detected that the virtual character moves along a blocking boundary of the blocking area 3, the original direction of the movement of the virtual character is adjusted to the tangent direction of the blocking boundary, that is: the tangent of the blocking boundary is made at the displacement origin of the virtual character, and the projection of the original direction of the movement of the virtual character on the tangent is used as the adjusted displacement direction. An angle threshold is preset to 30°, and the angle α between the original direction of the virtual character's movement and the adjusted displacement direction is obtained. When 0≤α<30°, the original displacement distance D1 determined by the flash displacement skill attribute is still used as the adjusted displacement distance D2, that is, D2=D1; otherwise, the original displacement distance D1 is adjusted according to the following formula (1) to obtain D2:

[0134]

[0135] The displacement target position is re-determined according to the displacement origin O of the virtual character releasing the flash displacement skill in the game scene, the above-adjusted displacement direction and the above-adjusted displacement distance D2. The re-determined displacement target position is again detected to see whether it is located in the blocking area 3, and the actual displacement target position T (equivalent to the above-mentioned second target position) of the flash displacement skill is re-determined according to the above-mentioned method.

[0136] Optionally, the method for controlling the movement of a virtual character may further include the following execution steps:

[0137] Step S402, in response to the plurality of candidate sampling positions being located in the blocking area, detecting whether the virtual character moves along a second blocking boundary of the blocking area;

[0138] Step S404, in response to the virtual character not moving along the second blocking boundary of the blocking area, obtaining a second intersection position between a second connecting line and the second blocking boundary, wherein the second connecting line is a connecting line between an original position of the virtual character in the game scene and the first target position;

[0139] Step S406: determine the second intersection position as the second target position.

[0140] When it is detected that the first target position is located in the blocking area, multiple candidate sampling positions are determined based on the first target position, and each of the multiple candidate sampling positions is detected to be located in the blocking area. When it is detected that each of the multiple candidate sampling positions is located in the blocking area, it is further detected whether the virtual character moves along a second blocking boundary of the blocking area, wherein the second blocking boundary may be a boundary where a line connecting the original position of the virtual character and the first target position intersects the blocking area for the first time starting from the original position.

[0141] When it is detected that the virtual character does not move along the second blocking boundary of the blocking area, the line between the original position of the virtual character in the game scene and the first target position is determined to be the second line. Then, the second intersection position between the second line and the second blocking boundary is obtained. The second intersection position may be the intersection position where the second line first intersects the second blocking area starting from the original position. Finally, the second intersection position is determined as the second target position, which is the final displacement target position of the virtual character.

[0142] Still taking the MOBA game running on smartphone as an example, Figure 8 is a schematic diagram of adjusting the displacement target position when the virtual character does not move along the blocking boundary according to one optional embodiment of the present invention, such as Figure 8As shown, the game player controls the virtual character to release the flash displacement skill at the displacement origin O in the game scene. When the multiple candidate sampling positions determined by the original displacement target position Q corresponding to the flash displacement skill are all located in the blocking area 3, it is necessary to detect whether the virtual character moves along a blocking boundary of the blocking area 3. The blocking boundary is the boundary where the line between the displacement origin O and the original target position corresponding to the flash displacement skill intersects the blocking area 3 for the first time starting from the displacement origin O.

[0143] Still like Figure 8 As shown, when it is detected that the virtual character is not moving along a blocking boundary of the blocking area 3, the intersection of the line connecting the displacement origin O and the original displacement target position Q and the blocking boundary is determined, and the intersection is determined as the actual displacement target position T of the flash displacement skill (equivalent to the above-mentioned second target position).

[0144] It should be noted that when the game player controls the virtual character to release a displacement skill in the game scene, when the first target position determined by the above-mentioned original position, the above-mentioned original direction and the above-mentioned first distance is outside the blocking area, the first target position is directly used as the above-mentioned second target position, and the virtual character is displaced to the second target position.

[0145] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0146] In the present embodiment, a device for controlling the movement of a virtual character is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.

[0147] Fig. 9 is a structural block diagram of a device for controlling the movement of a virtual character according to one embodiment of the present invention. Fig. 9As shown, the device includes: a first determination module 90, which is used to respond to the touch operation performed on the displacement control to determine the first target position of the virtual character in the game scene, wherein the first target position is the original displacement target position determined by the displacement skill attribute corresponding to the displacement control; a detection module 91, which is used to detect whether the first target position is located in a blocking area, wherein the blocking area is the area occupied by the virtual blocking object in the game scene; an acquisition module 92, which is used to respond to the first target position being located in the blocking area, and acquire multiple candidate sampling positions based on the first target position; a second determination module 93, which is used to determine the second target position using the multiple candidate sampling positions; and a control module 94, which is used to control the virtual character to move to the second target position.

[0148] Optionally, the acquisition module 92 is further used to: determine multiple sampling directions based on the first target position; determine the sampling interval using the first distance; and perform sampling in each of the multiple sampling directions according to the sampling interval to obtain multiple candidate sampling positions.

[0149] Optionally, the second determination module 93 is further configured to: select a target sampling position from a plurality of candidate sampling positions; and determine a second target position based on the target sampling position.

[0150] Optionally, the second determination module 93 is further used to: select some candidate sampling positions according to the positional relationship between each candidate sampling position among multiple candidate sampling positions and the blocking area, wherein some candidate sampling positions are outside the blocking area; select the target sampling position using the sequence identifier of each candidate sampling position among some candidate sampling positions, wherein the sequence identifier is determined by at least one of the second distance and the third distance, the second distance is the distance between each candidate sampling position and the first ray, the first ray is determined by the original position of the virtual character in the game scene and the first target position, and the third distance is the distance between each candidate sampling position and the first target position.

[0151] Optionally, the above-mentioned second determination module 93 is also used to: emit a second ray from the original position of the virtual character in the game scene to the target sampling position; determine the position to be used on the second ray based on the original position and the first distance corresponding to the displacement skill attribute; detect whether the position to be used is located in the blocking area; in response to the position to be used being outside the blocking area, determine the position to be used as the second target position.

[0152] Optionally, the above-mentioned second determination module 93 is also used to: emit a second ray from the original position of the virtual character in the game scene to the target sampling position; determine the position to be used on the second ray based on the original position and the first distance corresponding to the displacement skill attribute; detect whether the position to be used is located in the blocking area; in response to the position to be used being located in the blocking area, obtain the first intersection position between the first line and the first blocking boundary of the blocking area, wherein the first line is the line between the position to be used and the target sampling position; determine the first intersection position as the second target position.

[0153] Optionally, Fig.10 is a structural block diagram of a device for controlling the movement of a virtual character according to an optional embodiment of the present invention, such as Fig.10 As shown, the device includes Fig. 9 In addition to all the modules shown, the present invention also includes: a first adjustment module 95, which is used to detect whether the virtual character moves along the second blocking boundary of the blocking area in response to multiple candidate sampling positions being located in the blocking area; in response to the virtual character moving along the second blocking boundary of the blocking area, adjust the original orientation of the virtual character in the game scene to obtain an adjusted displacement direction; and when the angle between the original orientation and the displacement direction is greater than a preset angle threshold, adjust the first distance corresponding to the displacement skill attribute to obtain a fourth distance, wherein the fourth distance is less than the first distance; and detect again whether the first target position is located in the blocking area until the second target position is re-determined based on the adjusted displacement direction and the first distance or the fourth distance.

[0154] Optionally, Fig.11 is a structural block diagram of an apparatus for controlling movement of a virtual character according to another optional embodiment of the present invention, Fig.11 As shown, the device includes Fig.10 In addition to all the modules shown, it also includes: a second adjustment module 96, which is used to detect whether the virtual character moves along the second blocking boundary of the blocking area in response to multiple candidate sampling positions being located in the blocking area; in response to the virtual character not moving along the second blocking boundary of the blocking area, obtain the second intersection position between the second line and the second blocking boundary, wherein the second line is the line between the original position of the virtual character in the game scene and the first target position; and determine the second intersection position as the second target position.

[0155] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0156] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0157] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:

[0158] S1, in response to a touch operation performed on a displacement control, determining a first target position of a virtual character in a game scene, wherein the first target position is an original displacement target position determined by a displacement skill attribute corresponding to the displacement control;

[0159] S2, detecting whether the first target position is located in a blocking area, wherein the blocking area is an area occupied by a virtual blocking object in the game scene;

[0160] S3, in response to the first target position being located in the blocking area, acquiring a plurality of candidate sampling positions based on the first target position;

[0161] S4, determining a second target position using the plurality of candidate sampling positions;

[0162] S5, controlling the virtual character to move to a second target position.

[0163] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

[0164] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0165] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0166] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0167] S1, in response to a touch operation performed on a displacement control, determining a first target position of a virtual character in a game scene, wherein the first target position is an original displacement target position determined by a displacement skill attribute corresponding to the displacement control;

[0168] S2, detecting whether the first target position is located in a blocking area, wherein the blocking area is an area occupied by a virtual blocking object in the game scene;

[0169] S3, in response to the first target position being located in the blocking area, acquiring a plurality of candidate sampling positions based on the first target position;

[0170] S4, determining a second target position using the plurality of candidate sampling positions;

[0171] S5, controlling the virtual character to move to a second target position.

[0172] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0173] 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.

[0174] 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.

[0175] In the several embodiments provided by the present invention, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be 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.

[0176] 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 units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0177] 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.

[0178] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially 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. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0179] 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 the movement of a virtual character, It is characterized in that A graphical user interface is provided by a terminal device, wherein the content displayed by the graphical user interface at least includes a displacement control, and the method includes: In response to a touch operation performed on the displacement control, an original position, an original orientation, and a first distance corresponding to a displacement skill attribute of the virtual character in the game scene are obtained; a first target position is determined using the original position, the original orientation, and the first distance, wherein the original position is the displacement origin of the virtual character in the game scene, the original orientation is the orientation corresponding to the virtual character at the original position, and the first target position is the original displacement target position determined by the displacement skill attribute corresponding to the displacement control; Detecting whether the first target position is located in a blocking area, wherein the blocking area is an area occupied by a virtual blocking object in the game scene; In response to the first target position being located in the blocking area, a plurality of sampling directions are determined based on the first target position; a sampling interval is determined using the first distance; and sampling is performed in each sampling direction of the plurality of sampling directions according to the sampling interval to obtain a plurality of candidate sampling positions; Select a target sampling position from the multiple candidate sampling positions; send a second ray from the original position of the virtual character in the game scene to the target sampling position; determine the position to be used on the second ray according to the original position and the first distance corresponding to the displacement skill attribute; detect whether the position to be used is located in the blocking area; in response to the position to be used being located in the blocking area, obtain a first intersection position between a first connecting line and a first blocking boundary of the blocking area, wherein the first connecting line is a connecting line between the position to be used and the target sampling position; determine the first intersection position as the second target position; The virtual character is controlled to move to the second target position.

2. The method according to claim 1, It is characterized in that Selecting the target sampling position from the plurality of candidate sampling positions comprises: Selecting some candidate sampling positions according to the positional relationship between each candidate sampling position among the plurality of candidate sampling positions and the blocking area, wherein the some candidate sampling positions are outside the blocking area; The target sampling position is selected using the sequential identifier of each candidate sampling position in the partial candidate sampling positions, wherein the sequential identifier is determined by at least one of a second distance and a third distance, the second distance is the distance between each candidate sampling position and a first ray, the first ray is determined by the original position of the virtual character in the game scene and the first target position, and the third distance is the distance between each candidate sampling position and the first target position.

3. The method according to claim 1, It is characterized in that The method further comprises: Sending a second ray from the original position of the virtual character in the game scene to the target sampling position; Determine a position to be used on the second ray according to the original position and a first distance corresponding to the displacement skill attribute; Detecting whether the position to be used is located in the blocking area; In response to the position to be used being outside the blocking area, the position to be used is determined as the second target position.

4. The method according to claim 1, It is characterized in that The method further comprises: In response to the plurality of candidate sampling positions being located in the blocking area, detecting whether the virtual character moves along a second blocking boundary of the blocking area; In response to the virtual character moving along the second blocking boundary of the blocking area, the original orientation of the virtual character in the game scene is adjusted to obtain an adjusted displacement direction; and when the angle between the original orientation and the displacement direction is greater than a preset angle threshold, the first distance corresponding to the displacement skill attribute is adjusted to obtain a fourth distance, wherein the fourth distance is less than the first distance; and detecting again whether the first target position is located in the blocking area, until the second target position is re-determined according to the adjusted displacement direction and the first distance or the fourth distance.

5. The method according to claim 1, It is characterized in that The method further comprises: In response to the plurality of candidate sampling positions being located in the blocking area, detecting whether the virtual character moves along a second blocking boundary of the blocking area; In response to the virtual character not moving along the second blocking boundary of the blocking area, obtaining a second intersection position between a second connecting line and the second blocking boundary, wherein the second connecting line is a connecting line between an original position of the virtual character in the game scene and the first target position; The second intersection position is determined as the second target position.

6. A device for controlling the movement of a virtual character, It is characterized in that A graphical user interface is provided through a terminal device, wherein the content displayed by the graphical user interface at least includes a displacement control, and the device comprises: A first determination module is used to respond to the touch operation performed on the displacement control, obtain the original position, original orientation and a first distance corresponding to the displacement skill attribute of the virtual character in the game scene; determine a first target position using the original position, the original orientation and the first distance, wherein the original position is the displacement origin of the virtual character in the game scene, the original orientation is the orientation corresponding to the virtual character at the original position, and the first target position is the original displacement target position determined by the displacement skill attribute corresponding to the displacement control; A detection module, used to detect whether the first target position is located in a blocking area, wherein the blocking area is an area occupied by a virtual blocking object in the game scene; an acquisition module, configured to determine, in response to the first target position being located in the blocking area, a plurality of sampling directions based on the first target position; determine a sampling interval using the first distance; and perform sampling in each sampling direction of the plurality of sampling directions according to the sampling interval to obtain a plurality of candidate sampling positions; A second determination module is used to select a target sampling position from the multiple candidate sampling positions; send a second ray from the original position of the virtual character in the game scene to the target sampling position; determine the position to be used on the second ray according to the original position and the first distance corresponding to the displacement skill attribute; detect whether the position to be used is located in the blocking area; in response to the position to be used being located in the blocking area, obtain a first intersection position between a first connecting line and a first blocking boundary of the blocking area, wherein the first connecting line is a connecting line between the position to be used and the target sampling position; determine the first intersection position as the second target position; The control module is used to control the virtual character to move to the second target position.

7. A non-volatile storage medium, It is characterized in that The storage medium stores a computer program, wherein the computer program is configured to execute the method for controlling the movement of a virtual character as claimed in any one of claims 1 to 5 when running.

8. An electronic device comprising a memory and a processor, It is characterized in that The memory stores a computer program, and the processor is configured to run the computer program to execute the method for controlling the movement of a virtual character as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Object control method and device, storage medium and electronic device

    CN108635853A

  • Collision detection method and device, storage medium and electronic device

    CN110180182A

  • Virtual object control method and device

    CN111151003A

  • Virtual character control method, nonvolatile storage medium and electronic device

    CN113908550A

  • Game device, control method of game device and information storage medium

    US20100099469A1