Virtual character masking method and device, computer equipment and storage medium

文档序号:623980 发布日期:2021-05-11 浏览:33次 中文

阅读说明:本技术 一种虚拟角色掩蔽方法、装置、计算机设备及存储介质 (Virtual character masking method and device, computer equipment and storage medium ) 是由 董兆喆 倪琪标 于 2021-01-22 设计创作,主要内容包括:本公开提供了一种虚拟角色掩蔽方法、装置、计算机设备及存储介质,其中,该方法包括:响应于第一虚拟角色针对第二虚拟角色进入掩蔽状态,确定第一虚拟角色所处的场景中能够供第一虚拟角色掩蔽的多个候选掩蔽位置;基于各候选掩蔽位置对第一虚拟角色的掩蔽程度,从多个候选掩蔽位置中,确定针对第一虚拟角色的目标掩蔽位置;控制第一虚拟角色移动至目标掩蔽位置。从而,可以使得第一虚拟角色移动至供掩蔽的目标掩蔽位置,可以通过提高第一虚拟角色的隐蔽性,提升游戏场景的真实性,增加游戏内容的丰富性,有利于增加第一虚拟角色与玩家之间的互动性,提升玩家在游戏过程中的沉浸感。(The present disclosure provides a virtual character masking method, apparatus, computer device and storage medium, wherein the method comprises: in response to the fact that a first virtual character enters a masking state aiming at a second virtual character, determining a plurality of candidate masking positions, capable of being masked by the first virtual character, in a scene where the first virtual character is located; determining a target masking position for the first virtual character from a plurality of candidate masking positions based on the masking degree of each candidate masking position on the first virtual character; and controlling the first virtual character to move to the target masking position. Therefore, the first virtual character can move to the target masking position for masking, the reality of a game scene can be improved by improving the concealment of the first virtual character, the richness of game content is increased, the interactivity between the first virtual character and a player is favorably increased, and the immersion of the player in the game process is improved.)

1. A virtual character masking method, the method comprising:

in response to a first virtual character entering a masking state for a second virtual character, determining a plurality of candidate masking positions, which can be masked by the first virtual character, in a scene where the first virtual character is located;

determining a target masking position for the first virtual character from a plurality of candidate masking positions based on the masking degree of the first virtual character by each candidate masking position;

and controlling the first virtual character to move to the target masking position.

2. The virtual character masking method according to claim 1, wherein the determining a plurality of candidate masking positions that can be masked by the first virtual character in a scene where the first virtual character is located in response to the first virtual character entering a masking state for the second virtual character comprises:

in response to a first virtual character entering a masking state for a second virtual character, determining at least one mask capable of providing masking for the first virtual character in a scene based on environmental information of the scene in which the first virtual character is located;

determining at least one masking location for each of the at least one bunker;

and determining a plurality of candidate masking positions for masking by the first virtual character from a plurality of masking positions corresponding to the at least one shelter.

3. The virtual character masking method according to claim 2, wherein the determining, in response to a first virtual character entering a masking state for a second virtual character, at least one mask in a scene where the first virtual character can be masked based on environmental information of the scene where the first virtual character is located comprises:

in response to a first virtual character entering a masking state for a second virtual character, determining a plurality of blinders in a scene in which the first virtual character is located based on environmental information of the scene;

and determining that a cover in the plurality of covers within a preset range from the first virtual character is at least one cover capable of providing a cover for the first virtual character based on the position of the first character of the first virtual character in the scene.

4. The virtual character masking method as claimed in claim 2, wherein said determining at least one masking location for each of the at least one bunker comprises:

for each shelter, determining a regular frame covering the shelter;

determining at least one point location surrounding the regular frame body according to the size of a preset point location;

and determining the positions which are positioned at the edge of the shelter and correspond to the various sites as at least one shelter position of the shelter.

5. The virtual character masking method according to claim 2, wherein the determining a plurality of candidate masking positions for the first virtual character to mask from a plurality of masking positions corresponding to the at least one bunker comprises:

screening a masking position where a mask exists between the second virtual character and the at least one mask from a plurality of masking positions corresponding to the at least one mask based on a second character position of the second virtual character in the scene, a point position corresponding to each masking position and a mask position of each mask;

and determining the plurality of determined masking positions as a plurality of candidate masking positions which can be masked by the first virtual character.

6. The method of claim 1, wherein the determining a target masking position for the first avatar from a plurality of candidate masking positions based on the masking degree of the first avatar by each of the candidate masking positions comprises:

obtaining the masking degree of each candidate masking position relative to the first virtual character;

and taking the candidate masking position with the best masking degree in the plurality of candidate masking positions as the target masking position for the first virtual character.

7. The virtual character masking method according to claim 6, wherein said obtaining the masking degree of each of the candidate masking positions with respect to the first virtual character comprises:

determining a masking mode aiming at the first virtual role based on the role information of the first virtual role, wherein the masking mode comprises masking, masking and finding the next masking position, and masking and attacking;

calculating a masking value of each candidate masking position relative to the first virtual character based on the masking manner, the objective masking factor of each candidate masking position relative to the first virtual character and the subjective masking factor of the first virtual character; wherein the higher the masking value is, the better the masking degree of the corresponding candidate masking position is.

8. The virtual character masking method according to claim 7, wherein the objective masking factors include one or more of the following factors:

can be masked; the ability to attack; a distance between a shelter location and the first avatar; a distance between a shelter location and the second avatar; the masking posture corresponding to the position of the shelter; the height of the shelter corresponding to the shelter position, the width of the shelter corresponding to the shelter position and the type of the shelter.

9. The virtual character masking method as claimed in claim 7, wherein said subjective masking factors include one or more of the following:

a speed of movement of the first avatar; a movement time of the first avatar; an attack distance of the first virtual character; an attack interval of the first virtual character.

10. The avatar masking method of claim 1, wherein said controlling the first avatar to move to the target masking location comprises:

determining a moving pose of the first virtual character in the process of moving to the target masking position based on the spacing distance between the target masking position and the first virtual character and the attack information of the first virtual character;

and controlling the first virtual character to move to the target masking position according to the moving pose.

11. The virtual character masking method according to claim 10, wherein the movement pose includes at least one of:

move, move and attack, accelerate the movement.

12. An apparatus for masking a virtual character, the apparatus comprising:

the first determination module is used for determining a plurality of candidate masking positions, which can be masked by a first virtual character, in a scene where the first virtual character is located in response to the first virtual character entering a masking state for a second virtual character;

a second determination module, configured to determine a target masking position for the first virtual character from a plurality of candidate masking positions based on a masking degree of the first virtual character by each candidate masking position;

and the control module is used for controlling the first virtual role to move to the target masking position.

13. A computer device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating over the bus when a computer device is run, the machine-readable instructions when executed by the processor performing the steps of the virtual character masking method of any of claims 1 to 11.

14. A computer-readable storage medium, having stored thereon a computer program for performing the steps of the virtual character masking method of any one of claims 1 to 11 when executed by a processor.

Technical Field

The present disclosure relates to the field of game strategy technologies, and in particular, to a virtual character masking method, apparatus, computer device, and storage medium.

Background

In some games such as attack class, strategy class, etc., developers usually set some Non-Player characters (NPCs) for guiding players to play. The NPC may be a warrioble NPC, i.e., a player may gain honor after killing the NPC, or may obtain experience value or goods after killing the NPC.

Currently, in most games, the NPC is mostly fixed or preset to move within a certain range, that is, the NPC is located at a fixed position or within a certain range, the representation form is single and rigid, and the reality of the picture presentation scene is poor.

Disclosure of Invention

The embodiment of the disclosure at least provides a virtual role masking method, a virtual role masking device, computer equipment and a storage medium.

In a first aspect, an embodiment of the present disclosure provides a virtual character masking method, where the method includes:

in response to a first virtual character entering a masking state for a second virtual character, determining a plurality of candidate masking positions, which can be masked by the first virtual character, in a scene where the first virtual character is located;

determining a target masking position for the first virtual character from a plurality of candidate masking positions based on the masking degree of the first virtual character by each candidate masking position;

and controlling the first virtual character to move to the target masking position.

In an optional embodiment, the determining, in response to a first virtual character entering a masking state for a second virtual character, a plurality of candidate masking positions in a scene where the first virtual character is located and capable of being masked by the first virtual character includes:

in response to a first virtual character entering a masking state for a second virtual character, determining at least one mask capable of providing masking for the first virtual character in a scene based on environmental information of the scene in which the first virtual character is located;

determining at least one masking location for each of the at least one bunker;

and determining a plurality of candidate masking positions for masking by the first virtual character from a plurality of masking positions corresponding to the at least one shelter.

In an optional embodiment, the determining, in response to a first virtual character entering a masking state for a second virtual character, at least one shelter capable of providing masking for the first virtual character in a scene based on environmental information of the scene in which the first virtual character is located includes:

in response to a first virtual character entering a masking state for a second virtual character, determining a plurality of blinders in a scene in which the first virtual character is located based on environmental information of the scene;

and determining that a cover in the plurality of covers within a preset range from the first virtual character is at least one cover capable of providing a cover for the first virtual character based on the position of the first character of the first virtual character in the scene.

In an alternative embodiment, the determining at least one shelter location for each of the at least one shelter includes:

for each shelter, determining a regular frame covering the shelter;

determining at least one point location surrounding the regular frame body according to the size of a preset point location;

and determining the positions which are positioned at the edge of the shelter and correspond to the various sites as at least one shelter position of the shelter.

In an optional embodiment, the determining, from a plurality of masking positions corresponding to the at least one bunker, a plurality of candidate masking positions for masking by the first virtual character includes:

screening a masking position where a mask exists between the second virtual character and the at least one mask from a plurality of masking positions corresponding to the at least one mask based on a second character position of the second virtual character in the scene, a point position corresponding to each masking position and a mask position of each mask;

and determining the plurality of determined masking positions as a plurality of candidate masking positions which can be masked by the first virtual character.

In an optional implementation manner, the determining, from a plurality of candidate masking positions, a target masking position for the first virtual character based on the masking degree of the first virtual character by each candidate masking position includes:

obtaining the masking degree of each candidate masking position relative to the first virtual character;

and taking the candidate masking position with the best masking degree in the plurality of candidate masking positions as the target masking position for the first virtual character.

In an optional implementation manner, the obtaining a masking degree of each candidate masking position with respect to the first virtual character includes:

determining a masking mode aiming at the first virtual role based on the role information of the first virtual role, wherein the masking mode comprises masking, masking and finding the next masking position, and masking and attacking;

calculating a masking value of each candidate masking position relative to the first virtual character based on the masking manner, the objective masking factor of each candidate masking position relative to the first virtual character and the subjective masking factor of the first virtual character; wherein the higher the masking value is, the better the masking degree of the corresponding candidate masking position is.

In an alternative embodiment, the objective masking factors include one or more of the following:

can be masked; the ability to attack; a distance between a shelter location and the first avatar; a distance between a shelter location and the second avatar; the masking posture corresponding to the position of the shelter; the height of the shelter corresponding to the shelter position, the width of the shelter corresponding to the shelter position and the type of the shelter.

In an alternative embodiment, the subjective masking factors include one or more of the following:

a speed of movement of the first avatar; a movement time of the first avatar; an attack distance of the first virtual character; an attack interval of the first virtual character.

In an alternative embodiment, the controlling the first avatar to move to the target masking location includes:

determining a moving pose of the first virtual character in the process of moving to the target masking position based on the spacing distance between the target masking position and the first virtual character and the attack information of the first virtual character;

and controlling the first virtual character to move to the target masking position according to the moving pose.

In an optional embodiment, the moving pose includes at least one of:

move, move and attack, accelerate the movement.

In a second aspect, an embodiment of the present disclosure further provides a virtual character masking apparatus, where the apparatus includes:

the first determination module is used for determining a plurality of candidate masking positions, which can be masked by a first virtual character, in a scene where the first virtual character is located in response to the first virtual character entering a masking state for a second virtual character;

a second determination module, configured to determine a target masking position for the first virtual character from a plurality of candidate masking positions based on a masking degree of the first virtual character by each candidate masking position;

and the control module is used for controlling the first virtual role to move to the target masking position.

In an alternative embodiment, the first determining module includes:

the device comprises a first determining unit, a second determining unit and a third determining unit, wherein the first determining unit is used for responding to a first virtual character entering a masking state aiming at a second virtual character, and determining at least one mask capable of providing masking for the first virtual character in a scene based on environment information of the scene where the first virtual character is located;

a second determining unit, configured to determine at least one masking position of each of the at least one bunker;

a third determining unit, configured to determine, from a plurality of masking positions corresponding to the at least one bunker, a plurality of candidate masking positions for masking by the first virtual character.

In an optional implementation manner, the first determining unit is specifically configured to:

in response to a first virtual character entering a masking state for a second virtual character, determining a plurality of blinders in a scene in which the first virtual character is located based on environmental information of the scene;

and determining that a cover in the plurality of covers within a preset range from the first virtual character is at least one cover capable of providing a cover for the first virtual character based on the position of the first character of the first virtual character in the scene.

In an optional implementation manner, the second determining unit is specifically configured to:

for each shelter, determining a regular frame covering the shelter;

determining at least one point location surrounding the regular frame body according to the size of a preset point location;

and determining the positions which are positioned at the edge of the shelter and correspond to the various sites as at least one shelter position of the shelter.

In an optional implementation manner, the third determining unit is specifically configured to:

screening a masking position where a mask exists between the second virtual character and the at least one mask from a plurality of masking positions corresponding to the at least one mask based on a second character position of the second virtual character in the scene, a point position corresponding to each masking position and a mask position of each mask;

and determining the plurality of determined masking positions as a plurality of candidate masking positions which can be masked by the first virtual character.

In an alternative embodiment, the second determining module includes:

an obtaining unit configured to obtain a masking degree of each of the candidate masking positions with respect to the first virtual character;

a fourth determining unit, configured to use a candidate masking position with a best masking degree from among the plurality of candidate masking positions as a target masking position for the first avatar.

In an optional implementation manner, the obtaining module is specifically configured to:

determining a masking mode aiming at the first virtual role based on the role information of the first virtual role, wherein the masking mode comprises masking, masking and finding the next masking position, and masking and attacking;

calculating a masking value of each candidate masking position relative to the first virtual character based on the masking manner, the objective masking factor of each candidate masking position relative to the first virtual character and the subjective masking factor of the first virtual character; wherein the higher the masking value is, the better the masking degree of the corresponding candidate masking position is.

In an alternative embodiment, the objective masking factors include one or more of the following:

can be masked; the ability to attack; a distance between a shelter location and the first avatar; a distance between a shelter location and the second avatar; the masking posture corresponding to the position of the shelter; the height of the shelter corresponding to the shelter position, the width of the shelter corresponding to the shelter position and the type of the shelter.

In an alternative embodiment, the subjective masking factors include one or more of the following:

a speed of movement of the first avatar; a movement time of the first avatar; an attack distance of the first virtual character; an attack interval of the first virtual character.

In an optional implementation manner, the control module is specifically configured to:

determining a moving pose of the first virtual character in the process of moving to the target masking position based on the spacing distance between the target masking position and the first virtual character and the attack information of the first virtual character;

and controlling the first virtual character to move to the target masking position according to the moving pose.

In an optional embodiment, the moving pose includes at least one of:

move, move and attack, accelerate the movement.

In a third aspect, an embodiment of the present disclosure further provides a computer device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the computer device is running, the machine-readable instructions when executed by the processor performing the steps of the first aspect described above, or any possible implementation of the first aspect.

In a fourth aspect, this disclosed embodiment also provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps in the first aspect or any one of the possible implementation manners of the first aspect.

The embodiment of the disclosure provides a virtual role masking method, a virtual role masking device, a computer device and a storage medium, wherein the method comprises the following steps: in response to the fact that a first virtual character enters a masking state aiming at a second virtual character, determining a plurality of candidate masking positions, capable of being masked by the first virtual character, in a scene where the first virtual character is located; determining a target masking position for the first virtual character from a plurality of candidate masking positions based on the masking degree of each candidate masking position on the first virtual character; and controlling the first virtual character to move to the target masking position.

In the embodiment of the disclosure, a plurality of candidate masking positions for the first virtual character to mask are preliminarily determined, and further, a target masking position for the first virtual character is selected from the plurality of determined candidate masking positions, and the first virtual character is controlled to move to the determined target masking position, so that the first virtual character can move to the target masking position for masking, and by improving the concealment of the first virtual character, the reality of a game scene can be improved, the richness of game content can be increased, the interactivity between the first virtual character and a player can be favorably increased, and the immersion of the player in the game process can be improved.

In order to make the aforementioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments accompanied with figures are described in detail below.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly described below, and the drawings herein incorporated in and forming a part of the specification illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the technical solutions of the present disclosure. It is appreciated that the following drawings depict only certain embodiments of the disclosure and are therefore not to be considered limiting of its scope, for those skilled in the art will be able to derive additional related drawings therefrom without the benefit of the inventive faculty.

Fig. 1 shows a flowchart of a virtual character masking method provided by an embodiment of the present disclosure;

FIG. 2 illustrates a flow chart provided by an embodiment of the present disclosure for determining a plurality of candidate masking locations that can be masked by a first virtual character;

FIG. 3 illustrates a schematic diagram of a virtual role masking interface provided by an embodiment of the present disclosure;

FIG. 4 illustrates a flow chart for determining a target masking location from candidate masking locations provided by an embodiment of the present disclosure;

fig. 5 is a schematic diagram illustrating a virtual character masking apparatus provided in an embodiment of the present disclosure;

fig. 6 shows a specific schematic diagram of a first determining module in the virtual character masking apparatus provided in the embodiment of the present disclosure;

fig. 7 shows a specific schematic diagram of a second determining module in the virtual character masking apparatus provided in the embodiment of the present disclosure;

fig. 8 shows a schematic diagram of a computer device provided by an embodiment of the present disclosure.

Detailed Description

In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present disclosure, presented in the figures, is not intended to limit the scope of the claimed disclosure, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the disclosure without making creative efforts, shall fall within the protection scope of the disclosure.

It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.

The term "and/or" herein merely describes an associative relationship, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.

Research shows that in most games, the NPC is mostly fixed or preset moving within a certain range, that is, the NPC is located at a fixed position or within a certain range, the representation form is single and rigid, and the reality of the scene presented by the picture is poor.

Based on the research, the present disclosure provides a virtual character masking method, which preliminarily determines a plurality of candidate masking positions for masking a first virtual character, and further selects a target masking position for the first virtual character from the determined plurality of candidate masking positions, and controls the first virtual character to move to the determined target masking position, so that the first virtual character can move to the target masking position for masking, and by improving the concealment of the first virtual character, the reality of a game scene is improved, the richness of game contents is increased, the interaction between the first virtual character and a player is favorably increased, and the immersion of the player in the game process is improved.

To facilitate understanding of the present embodiment, first, a detailed description is given to a virtual character masking method disclosed in an embodiment of the present disclosure, where an execution subject of the virtual character masking method provided in the embodiment of the present disclosure is generally a computer device with certain computing capability, and the computer device includes, for example: a terminal device, which may be a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, a vehicle mounted device, a wearable device, or a server or other processing device. In some possible implementations, the virtual role masking method may be implemented by a processor invoking computer readable instructions stored in a memory.

Referring to fig. 1, a flowchart of a virtual character masking method provided in the embodiment of the present disclosure is shown, where the method includes steps S101 to S103, where:

s101: in response to a first virtual character entering a masking state for a second virtual character, a plurality of candidate masking positions, which can be masked by the first virtual character, in a scene where the first virtual character is located are determined.

In this step, when the first virtual character needs to be masked, a plurality of candidate masking positions that can be masked by the first virtual character may be determined based on a scene in which the first virtual character is located.

Wherein the first virtual character may be a non-player character, such as: monsters, BOSSs, etc. may be attacked by the players to obtain corresponding experiences, rewards, or dropped items, props, etc. The first virtual character may be a machine player set by a developer, that is, a machine player set to meet a competing requirement of a player, for example, a team population is filled or a competing character of the player during a game is increased. Correspondingly, the second virtual character may be a virtual character operated by the player.

In the disclosed embodiment, when entering the battle state, the first virtual character may be considered to have entered the masked state; or, when it is detected that the second virtual character is close to the first virtual character or within a certain area range centered on the first virtual character, the first virtual character can be considered to enter a masking state; still alternatively, the first avatar may be required to accomplish a specific task, such as: when sniping and burying, the first virtual role can be considered to enter the masking state, which is not described herein again.

In the embodiment of the present disclosure, after responding to the first virtual character entering the masking state for the second virtual character, it is necessary to determine a specific masking position that the first virtual character wants to mask, and preferably, a plurality of candidate masking positions that can be masked by the first virtual character may be determined first, and a final masking position for the first virtual character may be determined from the plurality of candidate masking positions.

Specifically, referring to fig. 2, a flowchart for determining a plurality of candidate masking positions capable of being masked by the first virtual character provided by the embodiment of the present disclosure includes steps S1011 to S1013, where:

s1011: in response to a first virtual character entering a masking state for a second virtual character, at least one mask capable of providing masking for the first virtual character in a scene is determined based on environmental information of the scene in which the first virtual character is located.

In this step, after responding to the first virtual character entering the masking state for the second virtual character, at least one mask capable of providing masking for the first virtual character may be determined based on a mask included in a scene in which the first virtual character is located.

The shelter is an object which can be used for the first virtual character to shelter.

Specifically, the determining, in response to a first virtual character entering a masking state with respect to a second virtual character, at least one mask capable of providing masking for the first virtual character in a scene based on environmental information of the scene where the first virtual character is located includes:

in response to a first virtual character entering a masking state for a second virtual character, determining a plurality of blinders in a scene in which the first virtual character is located based on environmental information of the scene;

and determining that a cover in the plurality of covers within a preset range from the first virtual character is at least one cover capable of providing a cover for the first virtual character based on the position of the first character of the first virtual character in the scene.

For example, after the first virtual character enters the masking state for the second virtual character, a plurality of masks in the scene in which the first virtual character is located, such as a plurality of masks displayed on the current game interface, or a plurality of masks displayed in the game minimap, may be screened out first. After determining the plurality of shelters in the scene, in the game space of the first virtual character, a plurality of shelters within a certain range centered on the first virtual character may be screened out, for example: a plurality of shelters within a distance of 10m or 20m from the first virtual character. Therefore, a plurality of shelters which can be sheltered by the first virtual character can be screened out preliminarily, and the subsequent shelter position determining process is carried out based on the plurality of shelters.

S1012: at least one shelter location is determined for each of the at least one shelter.

In this step, a masking position corresponding to each bunker may be determined based on the determined bunkers.

Specifically, the determining at least one masking position of each of the at least one shelter includes:

for each shelter, determining a regular frame covering the shelter;

determining at least one point location surrounding the regular frame body according to the size of a preset point location;

and determining the positions which are positioned at the edge of the shelter and correspond to the various sites as at least one shelter position of the shelter.

The regular frames of the shelter are frames describing the approximate shape of the shelter, and can be approximately spliced by rectangular frames, for example. The regular frame library can directly calculate the point position distribution of each shelter from the tool level through a pulled frame, and moreover, the shelter position belongs to the regular frame of the shelter, so that the corresponding shelter can be conveniently peeled off in the detection process, and the subsequent calculation is carried out. For a shelter, the shelter can be labeled through a regular box of the shelter, and then shelter point positions, namely shelter positions which can be sheltered as the first virtual character, are described around the regular box. Correspondingly, the points are points based on the conversion of the shelter, i.e. distributed around the frame of the shelter according to a set rule, e.g. outwards towards a vertical wall, etc.

Fig. 3 is a schematic diagram of a virtual character masking interface provided in the embodiment of the present disclosure. As shown in fig. 3, for each shelter a, the frame body may be extended outward with the central point thereof as a reference until the frame body covers the whole shelter, so as to obtain a regular frame body covering the shelter. Then, according to the preset size of the point, for example: the large-size, the medium-size and the like are arranged in the regular frame body in point positions, so that at least one point position surrounding the regular frame body is determined. Finally, a location at an edge of the bunker that corresponds based on the determined point location may be determined as at least one shelter location for the bunker.

S1013: and determining a plurality of candidate masking positions for masking by the first virtual character from a plurality of masking positions corresponding to the at least one shelter.

In this step, a plurality of candidate masking positions for masking by the first virtual character are determined based on a plurality of masking positions corresponding to at least one mask.

In this embodiment of the present disclosure, since the masking position corresponding to each mask may correspond to different directions, a plurality of masking positions corresponding to at least one mask may be screened based on the direction position corresponding to the second virtual character, so as to determine a plurality of candidate masking positions for the first virtual character to mask.

Specifically, the determining a plurality of candidate masking positions for masking the first virtual character from a plurality of masking positions corresponding to the at least one bunker includes:

screening a masking position where a mask exists between the second virtual character and the at least one mask from a plurality of masking positions corresponding to the at least one mask based on a second character position of the second virtual character in the scene, a point position corresponding to each masking position and a mask position of each mask;

and determining the plurality of determined masking positions as a plurality of candidate masking positions which can be masked by the first virtual character.

In this step, a plurality of masking positions corresponding to at least one bunker may be further screened based on the position of a second virtual character, the position of each bunker, the position of each point relative to each bunker, and the position of each point relative to the position of the second character, so as to screen out masking positions where a bunker exists between the masking positions and the second virtual character, and determine the determined masking positions as a plurality of candidate masking positions that can be masked by the first virtual character.

For example, as shown in fig. 3, if it is determined that the shelter a and the shelter B are shelters for the first virtual character to shelter from, and the second virtual character approaches the first virtual character from the right side, the shelter positions 3 and 6 cannot satisfy the purpose of the first virtual character for the purpose of the shelter. Thus, masking location 3 and masking location 6 may be screened out, and masking location 1, masking location 2, masking location 4, and masking location 5 may be determined as a plurality of candidate masking locations for masking by the first avatar. Thereby, candidate masking locations can be provided that satisfy the coarse masking requirements of the first avatar.

S102: and determining a target masking position for the first virtual character from a plurality of candidate masking positions based on the masking degree of the first virtual character by each candidate masking position.

In this step, after determining the plurality of candidate masking positions, a target masking position that can be masked finally by the first virtual character may be determined based on a masking degree of each candidate masking position to the first virtual character.

Specifically, referring to fig. 4, a flowchart for determining a target masking position in candidate masking positions provided by the embodiment of the present disclosure includes steps S1021 to S1022, where:

s1021: and acquiring the masking degree of each candidate masking position relative to the first virtual character.

In this step, the masking degree of each candidate masking position with respect to the first virtual character may be determined based on a preset masking degree evaluation index.

Specifically, the obtaining the masking degree of each candidate masking position with respect to the first virtual character includes:

determining a masking mode aiming at the first virtual role based on the role information of the first virtual role, wherein the masking mode comprises masking, masking and finding the next masking position, and masking and attacking;

calculating a masking value of each candidate masking position relative to the first virtual character based on the masking manner, the objective masking factor of each candidate masking position relative to the first virtual character and the subjective masking factor of the first virtual character; wherein the higher the masking value is, the better the masking degree of the corresponding candidate masking position is.

For example, the selection of the bunker position for the first avatar may be divided into three cases: the method is simple to conceal, to a position where the second virtual character can be attacked, and to a position where subsequent movement is convenient to avoid. For example: the first avatar may be masked nearby at the beginning of the battle, but as the battle progresses, it is considered to select a suitable shelter for attack or a suitable position for evasion to make an opportunistic output. Therefore, the masking mode for the first virtual character can be determined based on the three cases.

Specifically, for different masking manners and masking factors corresponding to different masking manners, including subjective masking factors and objective masking factors, a masking value of each candidate masking position relative to the first virtual character may be calculated, and a masking degree corresponding to each candidate masking position may be determined based on the masking value.

Wherein the objective masking factors include one or more of the following factors: can be masked; the ability to attack; a distance between a shelter location and the first avatar; a distance between a shelter location and the second avatar; the masking posture corresponding to the position of the shelter; the height of the shelter corresponding to the shelter position, the width of the shelter corresponding to the shelter position and the type of the shelter.

Illustratively, the types of the shelter can comprise a squatting shelter and a standing shelter, wherein the squatting shelter is used for ensuring the safety of the shelter only by needing to squat, but needing to stand up or walk to the side for attack, and the standing shelter is used for ensuring the safety of the shelter only by standing up, cannot attack in the shelter and needs to walk to the edge of the shelter for attack;

the subjective masking factors include one or more of the following: a speed of movement of the first avatar; a movement time of the first avatar; an attack distance of the first virtual character; an attack interval of the first virtual character.

For example, the moving time of the first virtual character may be calculated based on the distance between each candidate masking position of the first virtual character and the first character position of the first virtual character, and the moving speed of the first virtual character.

Specifically, whether the candidate masking location satisfies the masking condition of the masking and attack may be determined by: issuing a line to the second avatar from a plurality of candidate masking locations; and if the candidate masking position exists, wherein the straight line sent out to the second virtual character is only blocked by the shelter corresponding to the candidate masking position, determining that the candidate masking position meets the masking condition of masking and attacking. Correspondingly, whether the candidate masking shelter meets the masking condition of masking and finding the next masking position can be achieved through the following steps: determining a predicted distance of a candidate masking location of a shelter from a current location of the first virtual character, and a movement time for the first virtual character to move to the candidate masking location; and if the predicted distance meets a preset moving distance threshold value and/or the moving time meets a moving time threshold value, determining that the candidate masking position meets the masking condition of masking and searching for the next masking position.

For example, for the case that the masking manner is masking, the corresponding masking factor may include relatively few masking factors such as masking capability, a distance between a mask position and the first virtual character, a masking posture corresponding to the mask position, a height of a mask corresponding to the mask position, a width of a mask corresponding to the mask position, a type of the mask, and the like. For the masking manner of masking and attack, more masking factors need to be considered, which specifically include: can be masked; the ability to attack; a distance between a shelter location and the first avatar; a distance between a shelter location and the second avatar; the masking posture corresponding to the position of the shelter; the height of the shelter corresponding to the shelter position, the width of the shelter corresponding to the shelter position, and the type of the shelter also include certain subjective factors, which specifically include: an attack distance of the first virtual character; the attack interval of the first virtual character, and the like. The masking mode for masking and searching the next masking position specifically comprises the following steps: can be masked; the ability to attack; a distance between a shelter location and the first avatar; a distance between a shelter location and the second avatar; the masking posture corresponding to the position of the shelter; the height of the shelter corresponding to the shelter position, the width of the shelter corresponding to the shelter position, and the type of the shelter also include certain subjective factors, which specifically include: a speed of movement of the first avatar; the movement time of the first avatar, and the like. And determines a masking value for each masking mode with respect to the masking value ratio of the different masking factors and whether the masking value ratio is a decisive factor. Here, the masking capability can be regarded as a determining factor for each masking manner, and the masking capability can be attacked as a determining factor for a masking manner of masking and attacking.

For example, as shown in fig. 3, for a masking position 1, a masking position 2, a masking position 4, and a masking position 5 of candidate masking positions, since the shelter B is a cylindrical shelter, there may be less visual blind areas, and therefore, the shelter position 5 may be determined as a masking position that cannot be masked, and the corresponding masking value is lower or 0. For the masking position 2, the distance from the left edge of the masker a is far, and the right side is close to the masker B, so that it is not beneficial to attack at the masking position, therefore, the masking position 1 can be judged as a masking position incapable of being attacked, and the corresponding masking value is lower or 0 in the masking mode of masking and attacking. For the masking location 3 as well as the masking location 4, which are close in distance, the maskable and the offensive are similar. However, since the shelter B is low, when the first virtual position is located at the shelter position 4, the squat shelter is required, and therefore, the shelter position 4 has a low shelter value with respect to the shelter position 3, and therefore, it can be determined that the shelter degree of the shelter position 3 is the best.

S1022: and taking the candidate masking position with the best masking degree in the plurality of candidate masking positions as the target masking position for the first virtual character.

In this step, after determining the masking degree of each candidate masking position, a candidate masking position with the best masking degree may be determined as the target masking position for the first avatar.

Therefore, all candidate masking positions can be traversed through the steps, and the target masking position which is most suitable for masking by the first virtual character is selected.

S103: and controlling the first virtual character to move to the target masking position.

In this step, after the target masking position is determined, the first virtual character may be controlled to move to the target masking position.

Specifically, the controlling the first virtual character to move to the target masking position includes:

determining a moving pose of the first virtual character in the process of moving to the target masking position based on the spacing distance between the target masking position and the first virtual character and the attack information of the first virtual character;

and controlling the first virtual character to move to the target masking position according to the moving pose.

Wherein the moving pose comprises at least one of:

move, move and attack, accelerate the movement.

For example, when the first avatar is not attacked or the whereabouts of the second avatar are not detected, the first avatar may be moved to the target masking location at a crawl speed. However, when the first virtual character is attacked or the track of the second virtual character is detected, the moving speed can be increased to move to the target masking position more quickly, and in addition, the first virtual character can move in a squatting position to avoid the attack of the second virtual character; and the second virtual character can be attacked in the moving process, so that the game process is enriched. Or when the spacing distance between the target masking position and the first virtual character is longer, the moving speed is increased, and the exposure risk of the first virtual character is reduced. There are many possible situations for the pose transformation of the first virtual character during the movement process, and details are not described here. By adjusting the pose of the first virtual character in the moving process, the game playing method can be enriched, and the interestingness of the player in the game process is improved.

According to the embodiment of the disclosure, a plurality of candidate masking positions for the first virtual character to mask are preliminarily determined, and further, the target masking position for the first virtual character is selected from the plurality of determined candidate masking positions, and the first virtual character is controlled to move to the determined target masking position, so that the first virtual character can move to the target masking position for masking, the reality of a game scene can be improved by improving the concealment of the first virtual character, the richness of game contents is increased, the interactivity between the first virtual character and a player is favorably increased, and the immersion of the player in the game process is improved.

It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.

Based on the same inventive concept, the embodiment of the present disclosure further provides a virtual character masking apparatus corresponding to the virtual character masking method, and since the principle of the apparatus in the embodiment of the present disclosure for solving the problem is similar to that of the virtual character masking method in the embodiment of the present disclosure, the implementation of the apparatus may refer to the implementation of the method, and repeated details are not described again.

Referring to fig. 5, fig. 6, and fig. 7, fig. 5 is a schematic diagram of a virtual character masking apparatus provided in an embodiment of the present disclosure, and fig. 6 is a detailed schematic diagram of a first determining module in the virtual character masking apparatus provided in the embodiment of the present disclosure; fig. 7 is a specific schematic diagram of a second determining module in the virtual character masking apparatus according to the embodiment of the disclosure. The device comprises: a first determination module 510, a second determination module 520, a control module 530; wherein:

a first determining module 510, configured to determine, in response to a first virtual character entering a masking state for a second virtual character, a plurality of candidate masking positions that can be masked by the first virtual character in a scene where the first virtual character is located;

a second determining module 520, configured to determine a target masking position for the first virtual character from a plurality of candidate masking positions based on a masking degree of the first virtual character by each candidate masking position;

a control module 530 configured to control the first avatar to move to the target masking location.

In an alternative embodiment, as shown in fig. 6, the first determining module 510 includes:

a first determining unit 511, configured to, in response to a first virtual character entering a masking state for a second virtual character, determine, based on environment information of a scene in which the first virtual character is located, at least one mask capable of providing masking for the first virtual character in the scene;

a second determining unit 512, configured to determine at least one masking location of each of the at least one bunker;

a third determining unit 513, configured to determine, from a plurality of masking positions corresponding to the at least one bunker, a plurality of candidate masking positions for masking by the first virtual character.

In an optional implementation manner, the first determining unit 511 is specifically configured to:

in response to a first virtual character entering a masking state for a second virtual character, determining a plurality of blinders in a scene in which the first virtual character is located based on environmental information of the scene;

and determining that a cover in the plurality of covers within a preset range from the first virtual character is at least one cover capable of providing a cover for the first virtual character based on the position of the first character of the first virtual character in the scene.

In an optional implementation manner, the second determining unit 512 is specifically configured to:

for each shelter, determining a regular frame covering the shelter;

determining at least one point location surrounding the regular frame body according to the size of a preset point location;

and determining the positions which are positioned at the edge of the shelter and correspond to the various sites as at least one shelter position of the shelter.

In an optional implementation manner, the third determining unit 513 is specifically configured to:

screening a masking position where a mask exists between the second virtual character and the at least one mask from a plurality of masking positions corresponding to the at least one mask based on a second character position of the second virtual character in the scene, a point position corresponding to each masking position and a mask position of each mask;

and determining the plurality of determined masking positions as a plurality of candidate masking positions which can be masked by the first virtual character.

In an alternative embodiment, as shown in fig. 7, the second determining module 520 includes:

an obtaining unit 521, configured to obtain a masking degree of each candidate masking position with respect to the first virtual character;

a fourth determining unit 522, configured to use the candidate masking position with the best masking degree in the plurality of candidate masking positions as the target masking position for the first avatar.

In an optional implementation manner, the obtaining unit 521 is specifically configured to:

determining a masking mode aiming at the first virtual role based on the role information of the first virtual role, wherein the masking mode comprises masking, masking and finding the next masking position, and masking and attacking;

calculating a masking value of each candidate masking position relative to the first virtual character based on the masking manner, the objective masking factor of each candidate masking position relative to the first virtual character and the subjective masking factor of the first virtual character; wherein the higher the masking value is, the better the masking degree of the corresponding candidate masking position is.

In an alternative embodiment, the objective masking factors include one or more of the following:

can be masked; the ability to attack; a distance between a shelter location and the first avatar; a distance between a shelter location and the second avatar; the masking posture corresponding to the position of the shelter; the height of the shelter corresponding to the shelter position, the width of the shelter corresponding to the shelter position and the type of the shelter.

In an alternative embodiment, the subjective masking factors include one or more of the following:

a speed of movement of the first avatar; a movement time of the first avatar; an attack distance of the first virtual character; an attack interval of the first virtual character.

In an optional implementation manner, the control module 530 is specifically configured to:

determining a moving pose of the first virtual character in the process of moving to the target masking position based on the spacing distance between the target masking position and the first virtual character and the attack information of the first virtual character;

and controlling the first virtual character to move to the target masking position according to the moving pose.

In an optional embodiment, the moving pose includes at least one of:

move, move and attack, accelerate the movement.

The embodiment of the disclosure preliminarily determines a plurality of candidate masking positions for the first virtual character to mask, and further selects the target masking position for the first virtual character from the plurality of determined candidate masking positions, and controls the first virtual character to move to the determined target masking position, so that the first virtual character can move to the target masking position for masking, and by improving the concealment of the first virtual character, the reality of a game scene can be improved, the richness of game content can be increased, the interactivity between the first virtual character and a player can be increased, and the immersion of the player in the game process can be improved. The description of the processing flow of each module in the device and the interaction flow between the modules may refer to the related description in the above method embodiments, and will not be described in detail here.

Corresponding to the virtual role masking method in fig. 1, an embodiment of the present disclosure further provides a computer device, as shown in fig. 8, a schematic structural diagram of the computer device provided in the embodiment of the present disclosure includes:

a processor 801, a memory 802, and a bus 803; the memory 802 is used for storing instructions for execution and includes a memory 8021 and an external memory 8022; the memory 8021 is also referred to as an internal memory, and is configured to temporarily store operation data in the processor 801 and data exchanged with an external storage 8022 such as a hard disk, the processor 801 exchanges data with the external storage 8022 through the memory 8021, and when the computer apparatus is operated, the processor 801 communicates with the storage 802 through the bus 803, so that the processor 801 executes the following instructions:

in response to a first virtual character entering a masking state for a second virtual character, determining a plurality of candidate masking positions, which can be masked by the first virtual character, in a scene where the first virtual character is located;

determining a target masking position for the first virtual character from a plurality of candidate masking positions based on the masking degree of the first virtual character by each candidate masking position;

and controlling the first virtual character to move to the target masking position.

The embodiments of the present disclosure also provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the steps of the virtual role masking method in the above method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.

The embodiments of the present disclosure also provide a computer program product, where the computer program product carries a program code, and instructions included in the program code may be used to execute the steps of the virtual character masking method in the foregoing method embodiments, which may be referred to specifically in the foregoing method embodiments, and are not described herein again.

The computer program product may be implemented by hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.

It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.

The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present disclosure. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.

Finally, it should be noted that: the above-mentioned embodiments are merely specific embodiments of the present disclosure, which are used for illustrating the technical solutions of the present disclosure and not for limiting the same, and the scope of the present disclosure is not limited thereto, and although the present disclosure is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive of the technical solutions described in the foregoing embodiments or equivalent technical features thereof within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present disclosure, and should be construed as being included therein. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

20页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:虚拟空间建造方法、装置、电子设备以及计算机可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类