CN112774204B - Role collision avoidance method, device, equipment and storage medium - Google Patents
Role collision avoidance method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN112774204B CN112774204B CN202110093798.9A CN202110093798A CN112774204B CN 112774204 B CN112774204 B CN 112774204B CN 202110093798 A CN202110093798 A CN 202110093798A CN 112774204 B CN112774204 B CN 112774204B
- Authority
- CN
- China
- Prior art keywords
- character
- virtual character
- player
- virtual
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/80—Special adaptations for executing a specific game genre or game mode
- A63F13/822—Strategy games; Role-playing games
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/55—Controlling game characters or game objects based on the game progress
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/70—Game security or game management aspects
- A63F13/79—Game security or game management aspects involving player-related data, e.g. identities, accounts, preferences or play histories
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F2300/00—Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
- A63F2300/50—Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
- A63F2300/55—Details of game data or player data management
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F2300/00—Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
- A63F2300/80—Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game specially adapted for executing a specific type of game
- A63F2300/807—Role playing or strategy games
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Business, Economics & Management (AREA)
- Computer Security & Cryptography (AREA)
- General Business, Economics & Management (AREA)
- Human Computer Interaction (AREA)
- Processing Or Creating Images (AREA)
Abstract
本公开提供了一种角色碰撞规避方法、装置、设备以及存储介质,通过获取到的第一虚拟角色的第一运动信息和第二虚拟角色的第二运动信息确定出存在角色碰撞的情况下,控制第一虚拟角色进行运动规避,不仅可以保证虚拟角色控制的精准度和性能,还可以有效避免角色在行动中的碰撞,进而可以有效降低实际场景中角色因碰撞而产生模型穿插的概率,可以在有效保证场景的真实性和可靠性的前提下,使得画面更加逼真。
The present disclosure provides a character collision avoidance method, device, equipment and storage medium. When it is determined that there is a character collision through the obtained first motion information of the first virtual character and the second motion information of the second virtual character, Controlling the first virtual character to perform motion avoidance can not only ensure the accuracy and performance of the virtual character control, but also effectively avoid collisions of characters during actions, which can effectively reduce the probability of model interleaving due to collisions in actual scenes, and can On the premise of effectively ensuring the authenticity and reliability of the scene, the picture is made more realistic.
Description
技术领域Technical field
本公开涉及游戏技术领域,具体而言,涉及一种角色碰撞规避方法、装置、设备以及存储介质。The present disclosure relates to the field of game technology, and specifically to a character collision avoidance method, device, equipment and storage medium.
背景技术Background technique
随着电子科技的发展和网络技术的进步,电子游戏成为了越来越多人进行娱乐的选择,随着游戏技术的发展,MMO游戏(Massively Multiplayer Online,大型多人在线游戏)由于其具有极强的交互性,玩家可以在游戏中进行强烈的互动等优点,得到用户的青睐和喜爱。常见的MMO游戏有策略类或战略类、动作类、冒险类、模拟类、运动类、赛车类、角色扮演类等。With the development of electronic technology and network technology, electronic games have become an entertainment choice for more and more people. With the development of game technology, MMO games (Massively Multiplayer Online, massively multiplayer online games) have extremely Strong interactivity, players can have strong interactions in the game and other advantages, it is favored and loved by users. Common MMO games include strategy or strategy, action, adventure, simulation, sports, racing, role-playing, etc.
目前,在传统MMO游戏中,为了保护NPC(Non-Player Character,非玩家角色)受服务器控制的准确度和性能,NPC经常会发生重叠,即发生模型穿插,导致游戏画面失去真实性。Currently, in traditional MMO games, in order to protect the accuracy and performance of NPCs (Non-Player Characters) controlled by the server, NPCs often overlap, that is, model interleaving occurs, causing the game screen to lose authenticity.
发明内容Contents of the invention
本公开实施例至少提供一种角色碰撞规避方法、装置、设备以及存储介质。Embodiments of the present disclosure provide at least a character collision avoidance method, device, equipment and storage medium.
第一方面,本公开实施例提供了一种角色碰撞规避方法,所述方法包括:In a first aspect, embodiments of the present disclosure provide a character collision avoidance method, which method includes:
在第一虚拟角色响应目标运动事件进行运动的情况下,获取所述第一虚拟角色的第一运动信息,以及在距离所述第一虚拟角色预设范围内的第二虚拟角色的第二运动信息;所述第一虚拟角色为非玩家角色,所述第二虚拟角色为玩家角色或非玩家角色;When the first virtual character moves in response to the target motion event, obtain the first movement information of the first virtual character and the second movement of the second virtual character within a preset range from the first virtual character. Information; the first virtual character is a non-player character, and the second virtual character is a player character or a non-player character;
在基于所述第一运动信息和所述第二运动信息,确定所述第一虚拟角色与所述第二虚拟角色之间在未来预设时间段内存在角色碰撞的情况下,获取所述第一虚拟角色躲避所述第二虚拟角色的避让信息;When it is determined based on the first motion information and the second motion information that there is a character collision between the first virtual character and the second virtual character within a preset time period in the future, the third virtual character is obtained. Avoidance information for a virtual character to avoid the second virtual character;
控制所述第一虚拟角色按照所述避让信息进行运动。The first virtual character is controlled to move according to the avoidance information.
一种可选的实施方式中,可以通过以下步骤确定所述第一虚拟角色与所述第二虚拟角色之间在未来预设时间内存在角色碰撞:In an optional implementation, it may be determined that there is a character collision between the first virtual character and the second virtual character within a preset time in the future through the following steps:
确定所述第一运动信息指示的所述第一虚拟角色在所述未来预设时间段内的第一运动路线和第一运动速度信息,以及确定所述第二运动信息指示的所述第二虚拟角色在未来预设时间段内的第二运动路线和第二运动速度信息;Determine the first movement route and first movement speed information of the first virtual character indicated by the first movement information within the future preset time period, and determine the second movement speed information indicated by the second movement information. The second movement route and second movement speed information of the virtual character in the future preset time period;
根据所述第一运动路线和所述第一运动速度信息,以及所述第二运动路线和所述第二运动速度信息,判断所述第一虚拟角色和所述第二虚拟角色在未来预设时间段内是否存在角色碰撞。According to the first movement route and the first movement speed information, and the second movement route and the second movement speed information, it is determined whether the first virtual character and the second virtual character will be preset in the future. Whether there is character collision within the time period.
一种可选的实施方式中,根据所述第一运动路线和所述第一运动速度信息,以及所述第二运动路线和所述第二运动速度信息,判断所述第一虚拟角色和所述第二虚拟角色在未来预设时间段内是否存在角色碰撞,包括:In an optional implementation, the relationship between the first virtual character and the first movement speed is determined based on the first movement route and the first movement speed information, and the second movement route and the second movement speed information. Whether there is a character collision with the second virtual character within the preset time period in the future, including:
根据所述第一运动路线和所述第二运动路线,确定所述第一运动路线和所述第二运动路线之间是否存在预测碰撞位置,其中,所述预测相撞位置为所述第一运动路线和所述第二运动路线的交点,或者分别位于所述第一运动路线和所述第二运动路线上的距离小于预设距离的两个路线点;According to the first movement route and the second movement route, it is determined whether there is a predicted collision position between the first movement route and the second movement route, wherein the predicted collision position is the first The intersection of the movement route and the second movement route, or two route points respectively located on the first movement route and the second movement route whose distance is less than a preset distance;
若存在所述预测碰撞位置,基于所述第一运动速度信息和所述第一运动路线,确定所述第一虚拟角色运动到所述预测碰撞位置的第一时间,并基于所述第二运动速度信息和所述第二运动路线确定所述第二虚拟角色运动到所述预测碰撞位置的第二时间;If the predicted collision position exists, determine the first time for the first virtual character to move to the predicted collision position based on the first motion speed information and the first motion route, and determine the first time for the first virtual character to move to the predicted collision position based on the second motion. The speed information and the second motion route determine the second time when the second virtual character moves to the predicted collision position;
若所述第一时间与所述第二时间之间的时间差小于预设时间阈值,确定所述第一虚拟角色与所述第二虚拟角色之间在所述未来预设时间段内存在角色碰撞。If the time difference between the first time and the second time is less than the preset time threshold, it is determined that there is a character collision between the first virtual character and the second virtual character within the future preset time period. .
一种可选的实施方式中,所述获取所述第一虚拟角色躲避所述第二虚拟角色的避让信息,包括:In an optional implementation, the obtaining the avoidance information of the first virtual character avoiding the second virtual character includes:
检测所述第二虚拟角色的路权优先级是否高于所述第一虚拟角色的路权优先级;Detect whether the right-of-way priority of the second virtual character is higher than the right-of-way priority of the first virtual character;
若所述第二虚拟角色的路权优先级高于所述第一虚拟角色的路权优先级,获取所述第一虚拟角色的实体规避半径;If the right-of-way priority of the second virtual character is higher than the right-of-way priority of the first virtual character, obtain the physical avoidance radius of the first virtual character;
基于所述实体规避半径,对所述第一虚拟角色的运动进行调整,得到所述第一虚拟角色的规避信息;Based on the entity avoidance radius, adjust the movement of the first virtual character to obtain avoidance information of the first virtual character;
其中,所述规避信息包括以下信息中的一种或者多种:Wherein, the avoidance information includes one or more of the following information:
避让运动路线;避让运动速度;避让运动方向;避让运动时长。Avoidance movement route; avoidance movement speed; avoidance movement direction; avoidance movement duration.
一种可选的实施方式中,在所述检测所述第二虚拟角色的路权优先级是否高于所述第一虚拟角色的路权优先级之后,所述方法还包括:In an optional implementation, after detecting whether the right-of-way priority of the second virtual character is higher than the right-of-way priority of the first virtual character, the method further includes:
若所述第二虚拟角色的路权优先级低于所述第一虚拟角色的路权优先级,确定所述第一虚拟角色无需避让,控制所述第一虚拟角色按照所述第一运动信息运动。If the right-of-way priority of the second virtual character is lower than the right-of-way priority of the first virtual character, it is determined that the first virtual character does not need to avoid, and the first virtual character is controlled to follow the first movement information. sports.
一种可选的实施方式中,当所述第二虚拟角色为玩家角色,并且所述第一虚拟角色的路权优先级高于所述玩家角色的路权优先级时,所述方法包括:In an optional implementation, when the second virtual character is a player character, and the right-of-way priority of the first virtual character is higher than the right-of-way priority of the player character, the method includes:
为所述玩家角色绑定玩家物理层,并为所述第一虚拟角色绑定非玩家物理层;Bind a player physical layer to the player character, and bind a non-player physical layer to the first virtual character;
在检测到所述玩家角色向所述第一虚拟角色运动,并且所述玩家角色和所述第一虚拟角色之间能够发生碰撞时,控制所述玩家物理层和所述非玩家物理层之间彼此挤压,以避免所述玩家角色和所述第一虚拟角色之间的至少部分角色重叠。When it is detected that the player character moves toward the first virtual character and a collision can occur between the player character and the first virtual character, control the relationship between the player physical layer and the non-player physical layer. squeeze each other to avoid at least partial character overlap between the player character and the first avatar.
一种可选的实施方式中,所述方法包括:In an optional implementation, the method includes:
在所述第一虚拟角色向所述玩家角色运动,并向所述玩家角色施加攻击时,检测所述第一虚拟角色是否为近身攻击所述玩家角色;When the first virtual character moves toward the player character and attacks the player character, detect whether the first virtual character attacks the player character at close range;
若所述第一虚拟角色为近身攻击所述玩家角色,在所述第一虚拟角色攻击所述玩家角色时,控制所述非玩家物理层与所述玩家物理层重叠;If the first virtual character attacks the player character at close range, when the first virtual character attacks the player character, control the non-player physical layer to overlap with the player physical layer;
在所述非玩家物理层与所述玩家物理层发生重叠时,控制所述第一虚拟角色与所述玩家角色部分重叠,以使所述第一虚拟角色完成攻击所述玩家角色。When the non-player physical layer overlaps with the player physical layer, the first virtual character and the player character are controlled to partially overlap, so that the first virtual character completes attacking the player character.
第二方面,本公开实施例还提供一种角色碰撞规避装置,所述装置包括:In a second aspect, embodiments of the present disclosure also provide a character collision avoidance device, which includes:
运动信息获取模块,用于在第一虚拟角色响应目标运动事件进行运动的情况下,获取所述第一虚拟角色的第一运动信息,以及在距离所述第一虚拟角色预设范围内的第二虚拟角色的第二运动信息;所述第一虚拟角色为非玩家角色,所述第二虚拟角色为玩家角色或非玩家角色;A motion information acquisition module, configured to acquire the first motion information of the first virtual character and the first motion information of the first virtual character within a preset range from the first virtual character when the first virtual character moves in response to the target motion event. Second motion information of two virtual characters; the first virtual character is a non-player character, and the second virtual character is a player character or a non-player character;
避让信息获取模块,用于在基于所述第一运动信息和所述第二运动信息,确定所述第一虚拟角色与所述第二虚拟角色之间在未来预设时间段内存在角色碰撞的情况下,获取所述第一虚拟角色躲避所述第二虚拟角色的避让信息;An avoidance information acquisition module, configured to determine, based on the first motion information and the second motion information, that there is a character collision between the first virtual character and the second virtual character within a preset time period in the future. In this case, obtain the avoidance information of the first virtual character avoiding the second virtual character;
避让控制模块,用于控制所述第一虚拟角色按照所述避让信息进行运动。An avoidance control module is used to control the first virtual character to move according to the avoidance information.
一种可选的实施方式中,所述装置还包括碰撞预测模块,所述碰撞预测模块可以通过以下步骤确定所述第一虚拟角色与所述第二虚拟角色之间在未来预设时间内存在角色碰撞:In an optional implementation, the device further includes a collision prediction module. The collision prediction module can determine that there is a collision between the first virtual character and the second virtual character within a preset time in the future through the following steps: Role collision:
确定所述第一运动信息指示的所述第一虚拟角色在所述未来预设时间段内的第一运动路线和第一运动速度信息,以及确定所述第二运动信息指示的所述第二虚拟角色在未来预设时间段内的第二运动路线和第二运动速度信息;Determine the first movement route and first movement speed information of the first virtual character indicated by the first movement information within the future preset time period, and determine the second movement speed information indicated by the second movement information. The second movement route and second movement speed information of the virtual character in the future preset time period;
根据所述第一运动路线和所述第一运动速度信息,以及所述第二运动路线和所述第二运动速度信息,判断所述第一虚拟角色和所述第二虚拟角色在未来预设时间段内是否存在角色碰撞。According to the first movement route and the first movement speed information, and the second movement route and the second movement speed information, it is determined whether the first virtual character and the second virtual character will be preset in the future. Whether there is character collision within the time period.
一种可选的实施方式中,所述碰撞预测模块在用于根据所述第一运动路线和所述第一运动速度信息,以及所述第二运动路线和所述第二运动速度信息,判断所述第一虚拟角色和所述第二虚拟角色在未来预设时间段内是否存在角色碰撞时,具体用于:In an optional implementation, the collision prediction module is configured to determine based on the first movement route and the first movement speed information, and the second movement route and the second movement speed information. When there is a character collision between the first virtual character and the second virtual character within a preset time period in the future, it is specifically used to:
根据所述第一运动路线和所述第二运动路线,确定所述第一运动路线和所述第二运动路线之间是否存在预测碰撞位置,其中,所述预测相撞位置为所述第一运动路线和所述第二运动路线的交点,或者分别位于所述第一运动路线和所述第二运动路线上的距离小于预设距离的两个路线点;According to the first movement route and the second movement route, it is determined whether there is a predicted collision position between the first movement route and the second movement route, wherein the predicted collision position is the first The intersection of the movement route and the second movement route, or two route points respectively located on the first movement route and the second movement route whose distance is less than a preset distance;
若存在所述预测碰撞位置,基于所述第一运动速度信息和所述第一运动路线,确定所述第一虚拟角色运动到所述预测碰撞位置的第一时间,并基于所述第二运动速度信息和所述第二运动路线确定所述第二虚拟角色运动到所述预测碰撞位置的第二时间;If the predicted collision position exists, determine the first time for the first virtual character to move to the predicted collision position based on the first motion speed information and the first motion route, and determine the first time for the first virtual character to move to the predicted collision position based on the second motion. The speed information and the second motion route determine the second time when the second virtual character moves to the predicted collision position;
若所述第一时间与所述第二时间之间的时间差小于预设时间阈值,确定所述第一虚拟角色与所述第二虚拟角色之间在所述未来预设时间段内存在角色碰撞。If the time difference between the first time and the second time is less than the preset time threshold, it is determined that there is a character collision between the first virtual character and the second virtual character within the future preset time period. .
一种可选的实施方式中,所述避让信息获取模块具体用于:In an optional implementation, the avoidance information acquisition module is specifically used to:
检测所述第二虚拟角色的路权优先级是否高于所述第一虚拟角色的路权优先级;Detect whether the right-of-way priority of the second virtual character is higher than the right-of-way priority of the first virtual character;
若所述第二虚拟角色的路权优先级高于所述第一虚拟角色的路权优先级,获取所述第一虚拟角色的实体规避半径;If the right-of-way priority of the second virtual character is higher than the right-of-way priority of the first virtual character, obtain the physical avoidance radius of the first virtual character;
基于所述实体规避半径,对所述第一虚拟角色的运动进行调整,得到所述第一虚拟角色的规避信息;Based on the entity avoidance radius, adjust the movement of the first virtual character to obtain avoidance information of the first virtual character;
其中,所述规避信息包括以下信息中的一种或者多种:Wherein, the avoidance information includes one or more of the following information:
避让运动路线;避让运动速度;避让运动方向;避让运动时长。Avoidance movement route; avoidance movement speed; avoidance movement direction; avoidance movement duration.
一种可选的实施方式中,所述避让控制模块还用于:In an optional implementation, the avoidance control module is also used to:
若所述第二虚拟角色的路权优先级低于所述第一虚拟角色的路权优先级,确定所述第一虚拟角色无需避让,控制所述第一虚拟角色按照所述第一运动信息运动。If the right-of-way priority of the second virtual character is lower than the right-of-way priority of the first virtual character, it is determined that the first virtual character does not need to avoid, and the first virtual character is controlled to follow the first movement information. sports.
一种可选的实施方式中,当所述第二虚拟角色为玩家角色,并且所述第一虚拟角色的路权优先级高于所述玩家角色的路权优先级时,所述装置还包括物理层绑定模块,所述物理层绑定模块用于:In an optional implementation, when the second virtual character is a player character, and the right-of-way priority of the first virtual character is higher than the right-of-way priority of the player character, the device further includes Physical layer binding module, the physical layer binding module is used for:
为所述玩家角色绑定玩家物理层,并为所述第一虚拟角色绑定非玩家物理层;Bind a player physical layer to the player character, and bind a non-player physical layer to the first virtual character;
在检测到所述玩家角色向所述第一虚拟角色运动,并且所述玩家角色和所述第一虚拟角色之间能够发生碰撞时,控制所述玩家物理层和所述非玩家物理层之间彼此挤压,以避免所述玩家角色和所述第一虚拟角色之间的至少部分角色重叠。When it is detected that the player character moves toward the first virtual character and a collision can occur between the player character and the first virtual character, control the relationship between the player physical layer and the non-player physical layer. squeeze each other to avoid at least partial character overlap between the player character and the first avatar.
一种可选的实施方式中,所述装置还包括近身攻击控制模块,所述近身攻击控制模块用于:In an optional implementation, the device further includes a close attack control module, and the close attack control module is used to:
在所述第一虚拟角色向所述玩家角色运动,并向所述玩家角色施加攻击时,检测所述第一虚拟角色是否为近身攻击所述玩家角色;When the first virtual character moves toward the player character and attacks the player character, detect whether the first virtual character attacks the player character at close range;
若所述第一虚拟角色为近身攻击所述玩家角色,在所述第一虚拟角色攻击所述玩家角色时,控制所述非玩家物理层与所述玩家物理层重叠;If the first virtual character attacks the player character at close range, when the first virtual character attacks the player character, control the non-player physical layer to overlap with the player physical layer;
在所述非玩家物理层与所述玩家物理层发生重叠时,控制所述第一虚拟角色与所述玩家角色部分重叠,以使所述第一虚拟角色完成攻击所述玩家角色。When the non-player physical layer overlaps with the player physical layer, the first virtual character and the player character are controlled to partially overlap, so that the first virtual character completes attacking the player character.
第三方面,本公开实施例还提供一种计算机设备,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当计算机设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行上述角色碰撞规避方法的步骤。In a third aspect, embodiments of the present disclosure also provide a computer device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the computer device is running, the processing The processor communicates with the memory through a bus, and when the machine-readable instructions are executed by the processor, the steps of the character collision avoidance method are performed.
第四方面,本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述角色碰撞规避方法的步骤。In a fourth aspect, embodiments of the present disclosure also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is run by a processor, the steps of the character collision avoidance method are executed.
本公开实施例提供的角色碰撞规避方法、装置、设备以及存储介质,通过在第一虚拟角色响应目标运动事件进行运动的情况下,获取所述第一虚拟角色的第一运动信息,以及在距离所述第一虚拟角色预设范围内的第二虚拟角色的第二运动信息;所述第一虚拟角色为非玩家角色,所述第二虚拟角色为玩家角色或非玩家角色;在基于所述第一运动信息和所述第二运动信息,确定所述第一虚拟角色与所述第二虚拟角色之间在未来预设时间段内存在角色碰撞的情况下,获取所述第一虚拟角色躲避所述第二虚拟角色的避让信息;控制所述第一虚拟角色按照所述避让信息进行运动。The character collision avoidance method, device, equipment and storage medium provided by the embodiments of the present disclosure obtain the first motion information of the first virtual character when the first virtual character moves in response to a target motion event, and obtain the first motion information of the first virtual character in the distance. The second motion information of the second virtual character within the preset range of the first virtual character; the first virtual character is a non-player character, and the second virtual character is a player character or a non-player character; based on the The first motion information and the second motion information determine that there is a character collision between the first virtual character and the second virtual character within a preset time period in the future, and obtain the avoidance of the first virtual character. The avoidance information of the second virtual character; controlling the first virtual character to move according to the avoidance information.
这样,通过获取到的第一虚拟角色的第一运动信息和第二虚拟角色的第二运动信息确定出存在角色碰撞的情况下,控制第一虚拟角色进行运动规避,不仅可以保证虚拟角色控制的精准度和性能,还可以有效避免角色在行动中的碰撞,进而可以有效降低实际场景中角色因碰撞而产生模型穿插的概率,可以在有效保证场景的真实性和可靠性的前提下,使得画面更加逼真。In this way, when it is determined that there is a character collision through the obtained first motion information of the first virtual character and the second motion information of the second virtual character, controlling the first virtual character to perform motion avoidance can not only ensure the safety of the virtual character control The accuracy and performance can also effectively avoid collisions of characters in action, which can effectively reduce the probability of model interleaving of characters due to collisions in actual scenes, and can effectively ensure the authenticity and reliability of the scene to make the picture more precise. More realistic.
为使本公开的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。In order to make the above-mentioned objects, features and advantages of the present disclosure more obvious and understandable, preferred embodiments are given below and described in detail with reference to the accompanying drawings.
附图说明Description of the drawings
为了更清楚地说明本公开实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,此处的附图被并入说明书中并构成本说明书中的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。应当理解,以下附图仅示出了本公开的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to explain the technical solutions of the embodiments of the present disclosure more clearly, the drawings required to be used in the embodiments will be briefly introduced below. The drawings here are incorporated into the specification and constitute a part of this specification. These drawings are The drawings illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, without exerting creative efforts, they can also Other relevant drawings are obtained based on these drawings.
图1为本公开实施例提供的一种角色碰撞规避方法的流程图;Figure 1 is a flow chart of a character collision avoidance method provided by an embodiment of the present disclosure;
图2为本公开实施例中确定存在角色碰撞的流程图;Figure 2 is a flow chart for determining the existence of character collision in an embodiment of the present disclosure;
图3为本公开实施例提供的一种角色碰撞规避装置的示意图之一;Figure 3 is a schematic diagram of a character collision avoidance device provided by an embodiment of the present disclosure;
图4为本公开实施例提供的一种角色碰撞规避装置的示意图之二;Figure 4 is a second schematic diagram of a character collision avoidance device provided by an embodiment of the present disclosure;
图5为本公开实施例所提供的一种计算机设备的示意图。FIG. 5 is a schematic diagram of a computer device provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本公开实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本公开的实施例的详细描述并非旨在限制要求保护的本公开的范围,而是仅仅表示本公开的选定实施例。基于本公开的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only These are some embodiments of the present disclosure, but not all embodiments. The components of the embodiments of the present disclosure generally described and illustrated in the figures herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the disclosure provided in the appended drawings is not intended to limit the scope of the claimed disclosure, but rather to represent selected embodiments of the disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without any creative efforts shall fall within the scope of protection of the present disclosure.
经研究发现,目前在游戏场景中,为了保证角色在服务器控制下的准确度和性能,实际场景中经常会出现金素恩发生碰撞甚至角色重叠的现象,导致角色模型互相穿插,画面真实性大大降低,画面表现性差。Research has found that in current game scenarios, in order to ensure the accuracy and performance of characters under server control, Kim So-eun often collides or even overlaps characters in actual scenes, causing character models to intersperse with each other and greatly reducing the authenticity of the picture. Reduced, the picture performance is poor.
基于上述研究,本公开提供了一种角色碰撞规避方法,通过获取场景中第一虚拟角色的第一运动信息和第二虚拟角色的第二运动信息,在第一虚拟角色和第二虚拟角色存在角色碰撞的情况下,控制第一虚拟角色进行运动规避,不仅可以保证虚拟角色控制的精准度和性能,还可以有效避免角色在行动中的碰撞,进而可以有效降低实际场景中角色因碰撞而产生模型穿插的概率,可以在有效保证场景的真实性和可靠性的前提下,使得画面更加逼真。Based on the above research, the present disclosure provides a character collision avoidance method. By obtaining the first motion information of the first virtual character and the second motion information of the second virtual character in the scene, when the first virtual character and the second virtual character exist, In the case of character collision, controlling the first virtual character to perform motion avoidance can not only ensure the accuracy and performance of virtual character control, but also effectively avoid character collisions during action, which can effectively reduce the risk of character collisions in actual scenes. The probability of model interleaving can make the picture more realistic while effectively ensuring the authenticity and reliability of the scene.
针对以上方案所存在的缺陷,均是发明人在经过实践并仔细研究后得出的结果,因此,上述问题的发现过程以及下文中本公开针对上述问题所提出的解决方案,都应该是发明人在本公开过程中对本公开做出的贡献。The defects in the above solutions are all the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the present disclosure to the above problems below should be attributed to the inventor. Contributions made during the course of this disclosure.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。It should be noted that similar reference numerals and letters represent similar items in the following figures, therefore, once an item is defined in one figure, it does not need further definition and explanation in subsequent figures.
为便于对本实施例进行理解,首先对本公开实施例所公开的一种角色碰撞规避方法进行详细介绍,本公开实施例所提供的角色碰撞规避方法的执行主体一般为具有一定计算能力的计算机设备,该计算机设备例如包括:终端设备或服务器或其它处理设备,终端设备可以为用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字助理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等。在一些可能的实现方式中,该角色碰撞规避方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。In order to facilitate the understanding of this embodiment, a character collision avoidance method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the character collision avoidance method provided by the embodiment of the present disclosure is generally a computer device with certain computing capabilities. The computer device includes, for example: a terminal device or a server or other processing device. The terminal device may be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, or a personal digital assistant (Personal Digital Assistant). PDAs), handheld devices, computing devices, vehicle-mounted devices, wearable devices, etc. In some possible implementations, the character collision avoidance method can be implemented by the processor calling computer readable instructions stored in the memory.
下面以执行主体为终端设备为例对本公开实施例提供的角色碰撞规避方法加以说明。The character collision avoidance method provided by the embodiment of the present disclosure will be described below by taking the execution subject as a terminal device as an example.
请参阅图1,图1为本公开实施例提供的一种角色碰撞规避方法的流程图。如图1中所示,所述方法包括:Please refer to FIG. 1 , which is a flow chart of a character collision avoidance method provided by an embodiment of the present disclosure. As shown in Figure 1, the method includes:
S101:在第一虚拟角色响应目标运动事件进行运动的情况下,获取所述第一虚拟角色的第一运动信息,以及在距离所述第一虚拟角色预设范围内的第二虚拟角色的第二运动信息;所述第一虚拟角色为非玩家角色,所述第二虚拟角色为玩家角色或非玩家角色。S101: When the first virtual character moves in response to a target motion event, obtain the first motion information of the first virtual character and the second motion information of the second virtual character within a preset range from the first virtual character. 2. Movement information; the first virtual character is a non-player character, and the second virtual character is a player character or a non-player character.
该步骤中,在所述第一虚拟角色运动的情况下,例如处于运动状态中或者准备开始运动的情况下,可以获取到所述第一虚拟角色的第一运动信息,并且可以通过所述第一虚拟角色的位置信息或者第一运动信息等,确定出距离所述第一虚拟角色预设范围内的第二虚拟角色,例如以所述第一虚拟角色为中心的预设范围内,确定出的所述第二虚拟角色,或者是以所述第一虚拟角色运动轨迹等所处的预设范围的区域中的第二虚拟角色,然后可以获取所述第二虚拟角色的第二运动信息。进而,可以在后续通过所述第一运动信息和所述第二运动信息来判断所述第一虚拟角色和所述第二虚拟角色是否存在碰撞的可能。In this step, when the first virtual character is moving, for example, in a moving state or preparing to start moving, the first movement information of the first virtual character can be obtained, and the first movement information of the first virtual character can be obtained through the first virtual character. The position information or first motion information of a virtual character determines the second virtual character within a preset range from the first virtual character. For example, within a preset range centered on the first virtual character, determines the second virtual character. The second virtual character, or the second virtual character in a preset range area where the first virtual character's motion trajectory is located, and then the second motion information of the second virtual character can be obtained. Furthermore, whether there is a possibility of collision between the first virtual character and the second virtual character can be determined later based on the first motion information and the second motion information.
其中,所述第一虚拟角色为非玩家角色,即所述第一虚拟角色为怪物NPC(Non-Player Character)、剧情NPC、战斗NPC和服务NPC等由系统控制的虚拟角色,所述第二虚拟角色为玩家角色或非玩家角色,玩家角色即为玩家控制的虚拟角色。Wherein, the first virtual character is a non-player character, that is, the first virtual character is a virtual character controlled by the system such as a monster NPC (Non-Player Character), plot NPC, combat NPC, service NPC, etc., and the second virtual character is a virtual character controlled by the system. A virtual character is a player character or a non-player character, and a player character is a virtual character controlled by a player.
第一虚拟角色响应目标运动事件进行运动,可以是指所述第一虚拟角色在服务器的控制下,响应和执行既定的寻路、巡逻等任务事件,或者是与玩家角色或者非玩家角色交互后运动的非战斗事件,也或者是被玩家角色触发之后的战斗事件等。The first virtual character moves in response to a target movement event, which may mean that the first virtual character responds to and performs predetermined pathfinding, patrol and other task events under the control of the server, or after interacting with a player character or a non-player character. Movement non-combat events, or combat events triggered by player characters, etc.
S102:在基于所述第一运动信息和所述第二运动信息,确定所述第一虚拟角色与所述第二虚拟角色之间在未来预设时间段内存在角色碰撞的情况下,获取所述第一虚拟角色躲避所述第二虚拟角色的避让信息。S102: If it is determined based on the first motion information and the second motion information that there is a character collision between the first virtual character and the second virtual character within a preset time period in the future, obtain the The avoidance information of the first virtual character avoiding the second virtual character.
该步骤中,在通过所述第一运动信息和所述第二运动信息判定出所述第一虚拟角色与所述第二虚拟角色之间在未来预设时间段内可能会存在角色碰撞的话,那么就可以确认需要进行避让,继而可以获取所述第一虚拟角色躲避所述第二虚拟角色的避让信息。In this step, if it is determined based on the first motion information and the second motion information that there may be a character collision between the first virtual character and the second virtual character within a preset time period in the future, Then it can be confirmed that avoidance is required, and then the avoidance information of the first virtual character avoiding the second virtual character can be obtained.
其中,所述第一虚拟角色躲避所述第二虚拟角色,可以是指所述第一虚拟角色主动避让所述第二虚拟角色,即通过控制所述第一虚拟角色主动做出避让,以避免所述第一虚拟角色和所述第二虚拟角色之间的碰撞,也可以指所述第一虚拟角色被动避让所述第二虚拟角色,即通过控制所述第二虚拟角色主动做出避让,以达到所述第一虚拟角色被动避让,避免所述第一虚拟角色和所述第二虚拟角色之间的碰撞,还可以是所述第一虚拟角色与所述第二虚拟角色均进行相应的主动避让,以配合进行避让,避免所述第一虚拟角色和所述第二虚拟角色之间的碰撞。Wherein, the first virtual character avoiding the second virtual character may mean that the first virtual character actively avoids the second virtual character, that is, actively avoiding the second virtual character by controlling the first virtual character to avoid The collision between the first virtual character and the second virtual character may also refer to the first virtual character passively avoiding the second virtual character, that is, actively avoiding the second virtual character by controlling the second virtual character, In order to achieve the passive avoidance of the first virtual character and avoid the collision between the first virtual character and the second virtual character, it is also possible that the first virtual character and the second virtual character both perform corresponding actions. Actively avoid to cooperate with the avoidance to avoid collision between the first virtual character and the second virtual character.
相应的,所述第一虚拟角色是主动避让的话,那么对应的避让信息,即与所述第一运动信息不同,需要针对所述第一运动信息进行调整,以得到避让信息,而所述第一虚拟角色是被动避让的话,那么进行运动信息调整的就是所述第二虚拟角色,而所述第一虚拟角色可以不调整,即避让信息可以是与所述第一运动信息相同的。Correspondingly, if the first virtual character actively avoids, then the corresponding avoidance information, that is, different from the first movement information, needs to be adjusted for the first movement information to obtain the avoidance information, and the third movement information needs to be adjusted. If a virtual character passively avoids, then it is the second virtual character that adjusts the motion information, and the first virtual character does not need to adjust, that is, the avoidance information can be the same as the first motion information.
S103:控制所述第一虚拟角色按照所述避让信息进行运动。S103: Control the first virtual character to move according to the avoidance information.
该步骤中,在获取到所述避让信息后,就可以控制所述第一虚拟角色按照所述避让信息进行运动,以达到避免所述第一虚拟角色和所述第二虚拟角色发生碰撞的目的。In this step, after obtaining the avoidance information, the first virtual character can be controlled to move according to the avoidance information to achieve the purpose of avoiding collision between the first virtual character and the second virtual character. .
这样,本公开实施例提供的角色碰撞规避方法,在通过第一虚拟角色的第一运动信息和第二虚拟角色的第二运动信息确定两者存在角色碰撞的情况下,控制第一虚拟角色进行运动规避,以避免两者的碰撞,不仅可以保证虚拟角色控制的精准度和性能,还可以有效避免角色在行动中的碰撞,进而可以有效降低实际场景中角色因碰撞而产生模型穿插的概率,可以在有效保证场景的真实性和可靠性的前提下,使得画面更加逼真。In this way, the character collision avoidance method provided by the embodiment of the present disclosure controls the first virtual character to perform a collision when it is determined through the first motion information of the first virtual character and the second motion information of the second virtual character that there is a character collision between the two. Motion avoidance to avoid collisions between the two can not only ensure the accuracy and performance of virtual character control, but also effectively avoid collisions of characters in action, which can effectively reduce the probability of model interleaving due to collisions in actual scenes. It can make the picture more realistic while effectively ensuring the authenticity and reliability of the scene.
下面将结合具体实施例对上述S101~S103进行详细介绍。The above-mentioned S101 to S103 will be introduced in detail below with reference to specific embodiments.
相应的,请参阅图2,图2为本公开实施例中确定存在角色碰撞的流程图。在一些可能的实时方式中,可以通过以下步骤确定所述第一虚拟角色与所述第二虚拟角色之间在未来预设时间内存在角色碰撞:Correspondingly, please refer to Figure 2, which is a flow chart of determining the existence of character collision in an embodiment of the present disclosure. In some possible real-time methods, it can be determined that there is a character collision between the first virtual character and the second virtual character within a preset time in the future through the following steps:
S201:确定所述第一运动信息指示的所述第一虚拟角色在所述未来预设时间段内的第一运动路线和第一运动速度信息,以及确定所述第二运动信息指示的所述第二虚拟角色在未来预设时间段内的第二运动路线和第二运动速度信息。S201: Determine the first movement route and first movement speed information of the first virtual character indicated by the first movement information in the future preset time period, and determine the first movement speed information indicated by the second movement information. The second movement route and second movement speed information of the second virtual character within a preset time period in the future.
该步骤中,在获取到所述第一运动信息和所述第二运动信息之后,可以分别从所述第一运动信息和所述第二运动信息进行信息提取,以得到所述第一虚拟角色在所述未来预设时间段内的第一运动路线和第一运动速度信息,以及所述第二运动信息指示的所述第二虚拟角色在未来预设时间段内的第二运动路线和第二运动速度信息。In this step, after obtaining the first motion information and the second motion information, information can be extracted from the first motion information and the second motion information respectively to obtain the first virtual character. The first movement route and the first movement speed information within the future preset time period, and the second movement route and the second movement speed information of the second virtual character within the future preset time period indicated by the second movement information. 2. Movement speed information.
其中,所述第一运动路线和所述第二运动路线,可以是通过路线规划算法预先为相应角色规划的运动路线,例如通过VO(Velocity Obstacle)算法、RVO(ReciprocalVelocity Obstacle)算法、ORCA(Optimal Reciprocal Collision Avoidance)算法或者迪杰斯特拉(Dijkstra)算法等,为角色规划好的运动路径。Wherein, the first movement route and the second movement route may be movement routes planned in advance for the corresponding characters through a route planning algorithm, such as through the VO (Velocity Obstacle) algorithm, RVO (ReciprocalVelocity Obstacle) algorithm, ORCA (Optimal) Reciprocal Collision Avoidance) algorithm or Dijkstra algorithm, etc., plan the movement path for the character.
S202:根据所述第一运动路线和所述第一运动速度信息,以及所述第二运动路线和所述第二运动速度信息,判断所述第一虚拟角色和所述第二虚拟角色在未来预设时间段内是否存在角色碰撞。S202: Based on the first movement route and the first movement speed information, and the second movement route and the second movement speed information, determine the future of the first virtual character and the second virtual character. Whether there is character collision within the preset time period.
该步骤中,可以通过两个角色的运动路线和运动速度信息等,来判断两个虚拟角色在未来预设时间段内是否存在角色碰撞。In this step, it can be determined whether there is a character collision between the two virtual characters within a preset time period in the future based on the motion route and motion speed information of the two characters.
具体的,在一些可能的实施例中,S202包括:Specifically, in some possible embodiments, S202 includes:
S2021:根据所述第一运动路线和所述第二运动路线,确定所述第一运动路线和所述第二运动路线之间是否存在预测碰撞位置,其中,所述预测相撞位置为所述第一运动路线和所述第二运动路线的交点,或者分别位于所述第一运动路线和所述第二运动路线上的距离小于预设距离的两个路线点。S2021: According to the first movement route and the second movement route, determine whether there is a predicted collision position between the first movement route and the second movement route, wherein the predicted collision position is the The intersection point of the first movement route and the second movement route, or two route points respectively located on the first movement route and the second movement route whose distance is less than a preset distance.
该步骤中,可以通过对所述第一运动路线和所述第二运动路线进行比较,来看所述第一运动路线和所述第二运动路线之间是否存在预测碰撞位置,即所述第一运动路线和第二运动路线是否存在交叉和/或相邻较近的位置。In this step, the first movement route and the second movement route can be compared to see whether there is a predicted collision position between the first movement route and the second movement route, that is, the third movement route Whether the first movement route and the second movement route intersect and/or are adjacent to each other.
其中,所述预测相撞位置为所述第一运动路线和所述第二运动路线的交点,或者分别位于所述第一运动路线和所述第二运动路线上的距离小于预设距离的两个路线点。由于在实际的游戏场景中,角色是立体的,需要占用一定的立体空间,因此,如果两个角色相距较近,也可能会存在角色重叠,甚至模型穿插的现象,因此,如果两个路线点相距较近,也即可以认为是会导致角色碰撞的预测碰撞位置。Wherein, the predicted collision position is an intersection point of the first movement route and the second movement route, or two points where the distance between the first movement route and the second movement route is less than a preset distance. route point. Since in the actual game scene, the characters are three-dimensional and need to occupy a certain three-dimensional space, therefore, if the two characters are close to each other, the characters may overlap or even the models are interspersed. Therefore, if the two route points The distance is relatively close, which can be considered as the predicted collision position that will cause the character to collide.
S2022:若存在所述预测碰撞位置,基于所述第一运动速度信息和所述第一运动路线,确定所述第一虚拟角色运动到所述预测碰撞位置的第一时间,并基于所述第二运动速度信息和所述第二运动路线确定所述第二虚拟角色运动到所述预测碰撞位置的第二时间。S2022: If the predicted collision position exists, determine the first time when the first virtual character moves to the predicted collision position based on the first movement speed information and the first movement route, and determine The second movement speed information and the second movement route determine a second time for the second virtual character to move to the predicted collision position.
该步骤中,如果所述第一运动路线和所述第二运动路线之间存在所述预测碰撞位置的话,那么可以认为所述第一虚拟角色和所述第二虚拟角色之间存在空间维度上的碰撞几率,接着,可以看所述第一虚拟角色和所述第二虚拟角色之间是否存在时间维度上的碰撞几率,因此可以通过所述第一运动速度信息和所述第一运动路线,来确定出所述第一虚拟角色按照所述第一运动速度信息沿所述第一运动路线运动的话,运动到所述预测碰撞位置的第一时间,并通过所述第二运动速度信息和所述第二运动路线,来确定所述第二虚拟角色按照所述第二运动速度信息沿所述第二运动路线运动的话,运动到所述预测碰撞位置的第二时间。In this step, if there is the predicted collision position between the first movement route and the second movement route, then it can be considered that there is a spatial dimension between the first virtual character and the second virtual character. Then, it can be seen whether there is a collision probability in the time dimension between the first virtual character and the second virtual character. Therefore, through the first movement speed information and the first movement route, To determine the first time when the first virtual character moves to the predicted collision position if it moves along the first movement route according to the first movement speed information, and through the second movement speed information and the The second movement route is used to determine the second time when the second virtual character moves to the predicted collision position if it moves along the second movement route according to the second movement speed information.
S2023:若所述第一时间与所述第二时间之间的时间差小于预设时间阈值,确定所述第一虚拟角色与所述第二虚拟角色之间在所述未来预设时间段内存在角色碰撞。S2023: If the time difference between the first time and the second time is less than the preset time threshold, determine that the first virtual character and the second virtual character exist within the future preset time period. Characters collide.
该步骤中,如果所述第一时间与所述第二时间之间的时间差小于预设时间阈值的话,就可以认为所述第一虚拟角色与所述第二虚拟角色可能会在所述第一时间和所述第二时间之间发生碰撞,即在所述未来预设时间段内存在角色碰撞。In this step, if the time difference between the first time and the second time is less than a preset time threshold, it can be considered that the first virtual character and the second virtual character may be in the first time. A collision occurs between time and the second time, that is, there is a character collision within the future preset time period.
这样,可以通过运动路线和运动速度信息,判断所述第一虚拟角色和所述第二虚拟角色之间是否存在碰撞,预测当时简单明了,预测结果准确定较高,有利于实现对角色的精准控制以实现避让。In this way, it is possible to determine whether there is a collision between the first virtual character and the second virtual character through the motion route and motion speed information. The prediction is simple and clear at the time, and the prediction result is more accurate, which is conducive to achieving accurate prediction of the character. Control to achieve avoidance.
在一些可能的实施例中,步骤S102包括:In some possible embodiments, step S102 includes:
S1021:检测所述第二虚拟角色的路权优先级是否高于所述第一虚拟角色的路权优先级。S1021: Detect whether the right-of-way priority of the second virtual character is higher than the right-of-way priority of the first virtual character.
为了便于区分所述第一虚拟角色和所述第二虚拟角色谁进行主动避让,谁进行被动避让,可以根据角色属性等因素,预先为所述第一虚拟角色和所述第二虚拟角色配置好相应的路权级别,例如在实际游戏场景中,BOSS级别的怪物NPC可以比普通级别的怪物NPC的路权级别高,即BOSS级别的怪物NPC拥有优先路权,再例如战斗类型的怪物NPC可以比非战斗类型的怪物NPC路权级别高等,又例如灵活度高的NPC的路权级别比灵活度低的NPC的路权级别要高,相应的,具体影响路权级别的因素可以视游戏中具体内容而定。In order to easily distinguish between the first virtual character and the second virtual character who actively avoids and who passively avoids, the first virtual character and the second virtual character can be configured in advance according to character attributes and other factors. The corresponding right-of-way level. For example, in actual game scenarios, BOSS-level monster NPCs can have higher right-of-way levels than ordinary-level monster NPCs. That is, BOSS-level monster NPCs have priority right of way. For example, combat-type monster NPCs can The right of way level is higher than that of non-combat monster NPCs. For example, the right of way level of NPCs with high flexibility is higher than the right of way level of NPCs with low flexibility. Correspondingly, the specific factors that affect the right of way level can be determined in the game. Depends on the specific content.
因此,在该步骤中,可以通过获取所述第一虚拟角色的路权信息或者角色信息等可以指示所述第一虚拟角色的路权情况的信息,以及所述第二虚拟角色的路权信息或者角色信息等可以指示所述第二虚拟角色的路权情况的信息,来检测所述第二虚拟角色的路权优先级是否高于所述第一虚拟角色的路权优先级。Therefore, in this step, the right-of-way information or role information of the first virtual character can be obtained, which can indicate the right-of-way situation of the first virtual character, as well as the right-of-way information of the second virtual character. Or role information and other information may indicate the right-of-way situation of the second virtual character to detect whether the right-of-way priority of the second virtual character is higher than the right-of-way priority of the first virtual character.
S1022:若所述第二虚拟角色的路权优先级高于所述第一虚拟角色的路权优先级,获取所述第一虚拟角色的实体规避半径。S1022: If the right-of-way priority of the second virtual character is higher than the right-of-way priority of the first virtual character, obtain the physical avoidance radius of the first virtual character.
该步骤中,在检测出所述第二虚拟角色的路权优先级高于所述第一虚拟角色的路权优先级的时候,可以得知相较于所述第二虚拟角色,需要所述第一虚拟角色进行避让,即所述第一虚拟角色需要主动避让,相应的,可以获取所述第一虚拟角色的实体规避半径。In this step, when it is detected that the right-of-way priority of the second virtual character is higher than the right-of-way priority of the first virtual character, it can be known that compared with the second virtual character, the right-of-way priority is required. The first virtual character avoids, that is, the first virtual character needs to actively avoid. Correspondingly, the physical avoidance radius of the first virtual character can be obtained.
其中,实体规避半径,可以是指在游戏空间中,虚拟角色所占用的空间体积的半径,或者是虚拟角色在避让时所需要占用的避让空间的半径,可以通过不同角色的类型、体积、灵活度等属性信息等预先配置。例如,在实际游戏应用中,体积大的角色相应的实体规避半径较大,或者灵活度差的角色相应的实体规避半径较大等。Among them, the entity avoidance radius can refer to the radius of the space volume occupied by the virtual character in the game space, or the radius of the avoidance space that the virtual character needs to occupy when avoiding. It can be determined by the type, volume, and flexibility of different characters. Degree and other attribute information are pre-configured. For example, in actual game applications, the entity avoidance radius corresponding to a large character is larger, or the entity avoidance radius corresponding to a character with poor flexibility is larger, etc.
S1023:基于所述实体规避半径,对所述第一虚拟角色的运动进行调整,得到所述第一虚拟角色的规避信息。S1023: Based on the entity avoidance radius, adjust the movement of the first virtual character to obtain avoidance information of the first virtual character.
该步骤中,可以通过所述实体规避半径,调整所述第一虚拟角色的运动信息,以得到针对所述第一虚拟角色的规避信息。In this step, the movement information of the first virtual character can be adjusted through the entity avoidance radius to obtain avoidance information for the first virtual character.
其中,所述规避信息包括以下信息中的一种或者多种:Wherein, the avoidance information includes one or more of the following information:
避让运动路线;避让运动速度;避让运动方向;避让运动时长。Avoidance movement route; avoidance movement speed; avoidance movement direction; avoidance movement duration.
其中,这里所述规避信息,除包括的上述信息,即相应进行调整的信息外,还可以包括需要控制所述第一虚拟角色进行运动的其他信息,例如所述第一运动信息中未调整的其他信息。The avoidance information here, in addition to the above-mentioned information, that is, the information to be adjusted accordingly, may also include other information that needs to control the movement of the first virtual character, such as unadjusted information in the first movement information. other information.
相应的,在一些可能的实施例中,在S1021之后,所述方法还包括:Correspondingly, in some possible embodiments, after S1021, the method further includes:
若所述第二虚拟角色的路权优先级低于所述第一虚拟角色的路权优先级,确定所述第一虚拟角色无需避让,控制所述第一虚拟角色按照所述第一运动信息运动。If the right-of-way priority of the second virtual character is lower than the right-of-way priority of the first virtual character, it is determined that the first virtual character does not need to avoid, and the first virtual character is controlled to follow the first movement information. sports.
该步骤中,如果检测结果表示所述第二虚拟角色的路权优先级低于所述第一虚拟角色的路权优先级的话,那么可以认为所述第一虚拟角色相对于所述第二虚拟角色无需进行避让,即所述第一虚拟角色相对于所述第二虚拟角色是被动避让的,因此,可以将所述第一运动信息作为所述避让信息,也就是说,控制所述第一虚拟角色按照所述第一运动信息运动即可。In this step, if the detection result indicates that the right-of-way priority of the second virtual character is lower than the right-of-way priority of the first virtual character, then it can be considered that the first virtual character has a higher priority than the second virtual character. The character does not need to avoid, that is, the first virtual character passively avoids the second virtual character. Therefore, the first motion information can be used as the avoidance information, that is, the first virtual character is controlled to avoid The virtual character can move according to the first movement information.
上述内容,无论所述第二虚拟角色为玩家角色或者非玩家角色,针对的情况均是所述第二虚拟角色为非主动运动,即所述第二虚拟角色的运动,不是在玩家实时控制下,例如当所述第二虚拟角色为玩家角色时,在玩家角色不是被玩家实时控制下均可以适用避让,具体的,玩家控制玩家角色进行自动寻路,那玩家角色在自动寻路期间是可以进行避让判断的,而如果玩家实时的控制玩家角色运动,那么玩家角色会以玩家的控制为主,即便符合避让的情况,也不会进行避让,而是会按照玩家的控制进行运动。The above content, regardless of whether the second virtual character is a player character or a non-player character, is aimed at the situation that the second virtual character moves inactively, that is, the movement of the second virtual character is not under the real-time control of the player. , for example, when the second virtual character is a player character, avoidance can be applied even if the player character is not controlled by the player in real time. Specifically, if the player controls the player character to perform automatic path finding, then the player character can perform automatic path finding during the automatic path finding period. The avoidance judgment is made, and if the player controls the movement of the player character in real time, then the player character will be controlled by the player. Even if the avoidance situation is met, the player character will not avoid it, but will move according to the player's control.
相应的,对于非玩家角色的主动运动,可以通过绑定“胶囊体”等保护层的形式,以避免角色发生碰撞和模型穿插等现象,而非玩家角色也可以对应的绑定“胶囊体”等保护层,例如,设定客户端物理层,玩家设为“玩家层”,NPC角色设为“NPC层”,以避免玩家角色和非玩家角色的碰撞。“胶囊体”,可以理解为包括角色的层级设置,将角色包裹与其中,类似于胶囊的结构。Correspondingly, for the active movement of non-player characters, protective layers such as "capsules" can be bound to avoid character collisions and model interleaving. Non-player characters can also be bound with "capsules" accordingly. Wait for the protection layer, for example, set the client physical layer, set the player to the "player layer", and set the NPC character to the "NPC layer" to avoid collisions between player characters and non-player characters. "Capsule" can be understood as including the hierarchical setting of the character, wrapping the character within it, similar to the structure of a capsule.
相应的,在一些可能的实施例中,当所述第二虚拟角色为玩家角色,并且所述第一虚拟角色的路权优先级高于所述玩家角色的路权优先级时,所述方法包括:Correspondingly, in some possible embodiments, when the second virtual character is a player character, and the right-of-way priority of the first virtual character is higher than the right-of-way priority of the player character, the method include:
为所述玩家角色绑定玩家物理层,并为所述第一虚拟角色绑定非玩家物理层;在检测到所述玩家角色向所述第一虚拟角色运动,并且所述玩家角色和所述第一虚拟角色之间能够发生碰撞时,控制所述玩家物理层和所述非玩家物理层之间彼此挤压,以避免所述玩家角色和所述第一虚拟角色之间的至少部分角色重叠。Bind a player physical layer to the player character, and bind a non-player physical layer to the first virtual character; after detecting that the player character moves toward the first virtual character, and the player character and the When a collision can occur between the first virtual characters, control the player physical layer and the non-player physical layer to squeeze each other to avoid at least partial character overlap between the player character and the first virtual character. .
该步骤中,可以对所述玩家角色绑定玩家物理层,对所述第一虚拟角色绑定非玩家物理层,以实现为角色绑定“胶囊体”,然后,在检测到所述玩家角色向所述第一虚拟角色运动,并且两者之间能够发生碰撞的时候,那么在碰撞的时候,可以控制所述玩家物理层和所述非玩家物理层之间批次挤压,但层级之间不会发生交叉和重叠,从而可以避免所述玩家角色和所述第一虚拟角色之间可能会发生的至少部分角色重叠。In this step, a player physical layer can be bound to the player character, and a non-player physical layer can be bound to the first virtual character, so as to bind a "capsule" to the character. Then, after detecting the player character When moving towards the first virtual character and a collision can occur between the two, then at the time of collision, batch extrusion between the player physical layer and the non-player physical layer can be controlled, but between levels There will be no intersection or overlap between the player characters and the first virtual character, so that at least partial character overlap that may occur between the player character and the first virtual character can be avoided.
这样,通过为角色设置保护层,可以在碰撞的时候通过保护层间的挤压实现碰撞效果,但是角色之间无法运动到重叠或者穿插的地步,从而保证了玩家角色和非玩家角色不会发生实体碰撞和模型穿插的现象。In this way, by setting a protective layer for the character, the collision effect can be achieved through the extrusion between the protective layers during collision, but the characters cannot move to the point of overlapping or interspersing, thus ensuring that player characters and non-player characters will not The phenomenon of entity collision and model interleaving.
在一些可能的实施例中,所述方法还包括:In some possible embodiments, the method further includes:
在所述第一虚拟角色向所述玩家角色运动,并向所述玩家角色施加攻击时,检测所述第一虚拟角色是否为近身攻击所述玩家角色;若所述第一虚拟角色为近身攻击所述玩家角色,在所述第一虚拟角色攻击所述玩家角色时,控制所述非玩家物理层与所述玩家物理层重叠;在所述非玩家物理层与所述玩家物理层发生重叠时,控制所述第一虚拟角色与所述玩家角色部分重叠,以使所述第一虚拟角色完成攻击所述玩家角色。When the first virtual character moves toward the player character and attacks the player character, detect whether the first virtual character attacks the player character at close range; if the first virtual character attacks at close range Attack the player character personally, and when the first virtual character attacks the player character, control the non-player physical layer to overlap with the player physical layer; when the non-player physical layer and the player physical layer occur When overlapping, the first virtual character and the player character are controlled to partially overlap, so that the first virtual character completes attacking the player character.
该步骤中,如果所述第一虚拟角色向所述玩家角色运动,并想要向所述玩家角色施加攻击时,例如所述玩家角色触发了所述第一虚拟角色的仇恨,导致所述第一虚拟角色朝向所述玩家角色运动并欲做出攻击的话,需要看所述第一虚拟角色是否为近身攻击所述玩家角色,如果是近身攻击的话,那么认为所述第一虚拟角色和所述玩家角色之间可能会需要进行碰撞,那么在所述第一虚拟角色攻击所述玩家角色时,可以控制所述非玩家物理层与所述玩家物理层重叠,以在所述非玩家物理层与所述玩家物理层重叠时,使得所述第一虚拟角色与所述玩家角色部分重叠,以实现所述第一虚拟角色攻击所述玩家角色的效果,但是在所述第一虚拟角色进行攻击等主动位移结束后,立刻回复寻路规避,如追逐所述玩家角色的寻路等,来保证所述第一虚拟角色和所述玩家角色之间分开。In this step, if the first virtual character moves towards the player character and wants to attack the player character, for example, the player character triggers the hatred of the first virtual character, resulting in the If a virtual character moves towards the player character and wants to attack, it needs to see whether the first virtual character is attacking the player character at close range. If it is a close attack, then it is considered that the first virtual character and There may be a need for collision between the player characters. Then when the first virtual character attacks the player character, the non-player physical layer can be controlled to overlap with the player physical layer, so that when the non-player physical layer When the layer overlaps with the player's physical layer, the first virtual character partially overlaps with the player character to achieve the effect of the first virtual character attacking the player character, but when the first virtual character performs After the active displacement such as attacking ends, pathfinding and avoidance is immediately resumed, such as chasing the pathfinding of the player character, etc. to ensure separation between the first virtual character and the player character.
其中,所述第一虚拟角色向所述玩家角色运动,可以是因为所述玩家角色触发了所述第一虚拟角色的仇恨,例如触发所述第一虚拟角色需要进行攻击的仇恨,还可以是触发所述第一虚拟角色与所述玩家角色需要进行互动的机制等。Wherein, the first virtual character moves towards the player character, which may be because the player character triggers the hatred of the first virtual character, for example, triggers the hatred that the first virtual character needs to attack, or it may be because Triggering a mechanism for interaction between the first virtual character and the player character, etc.
这样,通过设置非玩家物理层可以与玩家物理层重叠,以保证实现第一虚拟玩家的攻击的效果,在攻击后,控制非玩家物理层与玩家物理层的分开,实现两个角色之间位置的不干扰,避免碰撞甚至模型穿插造成的画面不真实的时间,而且在攻击结束后,即使两个角色短暂的碰撞接触后,也会通过控制非玩家角色移动,和玩家角色的主动运动或者玩家控制玩家角色的二次控制输入等原因使得两个角色快速分离。In this way, the non-player physical layer can be set to overlap with the player physical layer to ensure the effect of the first virtual player's attack. After the attack, the separation of the non-player physical layer and the player physical layer is controlled to achieve the position between the two characters. No interference, avoid collisions or even unrealistic scenes caused by model interleaving, and after the attack is over, even if the two characters briefly collide and contact, they will control the movement of the non-player character, and the active movement of the player character or the player The two characters quickly separated due to reasons such as secondary control input to control the player character.
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。Those skilled in the art can understand that in the above-mentioned methods of specific embodiments, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be based on its function and possible The internal logic is determined.
基于同一发明构思,本公开实施例中还提供了与角色碰撞规避方法对应的角色碰撞规避装置,由于本公开实施例中的装置解决问题的原理与本公开实施例上述角色碰撞规避方法相似,因此装置的实施可以参见方法的实施,重复之处不再赘述。其中,角色碰撞规避装置可以是服务器,也可以是与服务器连接的独立的设备。Based on the same inventive concept, the embodiment of the present disclosure also provides a character collision avoidance device corresponding to the character collision avoidance method. Since the principle of solving the problem of the device in the embodiment of the present disclosure is similar to the above-mentioned character collision avoidance method of the embodiment of the present disclosure, therefore For the implementation of the device, please refer to the implementation of the method, and repeated details will not be repeated. The character collision avoidance device may be a server or an independent device connected to the server.
请参阅图3和图4,图3为本公开实施例提供的一种角色碰撞规避装置的示意图之一,图4为本公开实施例提供的一种角色碰撞规避装置的示意图之二。如图3中所示,本公开实施例提供的角色碰撞规避装置300包括:Please refer to FIGS. 3 and 4 . FIG. 3 is a first schematic diagram of a character collision avoidance device provided by an embodiment of the present disclosure. FIG. 4 is a second schematic diagram of a character collision avoidance device provided by an embodiment of the present disclosure. As shown in Figure 3, the character collision avoidance device 300 provided by the embodiment of the present disclosure includes:
运动信息获取模块310,用于在第一虚拟角色响应目标运动事件进行运动的情况下,获取所述第一虚拟角色的第一运动信息,以及在距离所述第一虚拟角色预设范围内的第二虚拟角色的第二运动信息;所述第一虚拟角色为非玩家角色,所述第二虚拟角色为玩家角色或非玩家角色。The motion information acquisition module 310 is configured to acquire the first motion information of the first virtual character when the first virtual character moves in response to a target motion event, and the first motion information of the first virtual character within a preset range from the first virtual character. Second motion information of the second virtual character; the first virtual character is a non-player character, and the second virtual character is a player character or a non-player character.
避让信息获取模块320,用于在基于所述第一运动信息和所述第二运动信息,确定所述第一虚拟角色与所述第二虚拟角色之间在未来预设时间段内存在角色碰撞的情况下,获取所述第一虚拟角色躲避所述第二虚拟角色的避让信息。The avoidance information acquisition module 320 is configured to determine, based on the first motion information and the second motion information, that there is a character collision between the first virtual character and the second virtual character within a preset time period in the future. In this case, the avoidance information of the first virtual character avoiding the second virtual character is obtained.
避让控制模块330,用于控制所述第一虚拟角色按照所述避让信息进行运动。The avoidance control module 330 is used to control the first virtual character to move according to the avoidance information.
一种可选的实施方式中,如图4中所示,所述角色碰撞规避装置300还包括碰撞预测模块340,所述碰撞预测模块340可以通过以下步骤确定所述第一虚拟角色与所述第二虚拟角色之间在未来预设时间内存在角色碰撞:In an optional implementation, as shown in Figure 4, the character collision avoidance device 300 further includes a collision prediction module 340. The collision prediction module 340 can determine the relationship between the first virtual character and the first virtual character through the following steps: There will be a character collision between the second virtual characters in the future preset time:
确定所述第一运动信息指示的所述第一虚拟角色在所述未来预设时间段内的第一运动路线和第一运动速度信息,以及确定所述第二运动信息指示的所述第二虚拟角色在未来预设时间段内的第二运动路线和第二运动速度信息;Determine the first movement route and first movement speed information of the first virtual character indicated by the first movement information within the future preset time period, and determine the second movement speed information indicated by the second movement information. The second movement route and second movement speed information of the virtual character in the future preset time period;
根据所述第一运动路线和所述第一运动速度信息,以及所述第二运动路线和所述第二运动速度信息,判断所述第一虚拟角色和所述第二虚拟角色在未来预设时间段内是否存在角色碰撞。According to the first movement route and the first movement speed information, and the second movement route and the second movement speed information, it is determined whether the first virtual character and the second virtual character will be preset in the future. Whether there is character collision within the time period.
一种可选的实施方式中,所述碰撞预测模块340在用于根据所述第一运动路线和所述第一运动速度信息,以及所述第二运动路线和所述第二运动速度信息,判断所述第一虚拟角色和所述第二虚拟角色在未来预设时间段内是否存在角色碰撞时,具体用于:In an optional implementation, the collision prediction module 340 is configured to calculate based on the first movement route and the first movement speed information, and the second movement route and the second movement speed information, When determining whether there is a character collision between the first virtual character and the second virtual character within a preset time period in the future, it is specifically used to:
根据所述第一运动路线和所述第二运动路线,确定所述第一运动路线和所述第二运动路线之间是否存在预测碰撞位置,其中,所述预测相撞位置为所述第一运动路线和所述第二运动路线的交点,或者分别位于所述第一运动路线和所述第二运动路线上的距离小于预设距离的两个路线点;According to the first movement route and the second movement route, it is determined whether there is a predicted collision position between the first movement route and the second movement route, wherein the predicted collision position is the first The intersection of the movement route and the second movement route, or two route points respectively located on the first movement route and the second movement route whose distance is less than a preset distance;
若存在所述预测碰撞位置,基于所述第一运动速度信息和所述第一运动路线,确定所述第一虚拟角色运动到所述预测碰撞位置的第一时间,并基于所述第二运动速度信息和所述第二运动路线确定所述第二虚拟角色运动到所述预测碰撞位置的第二时间;If the predicted collision position exists, determine the first time for the first virtual character to move to the predicted collision position based on the first motion speed information and the first motion route, and determine the first time for the first virtual character to move to the predicted collision position based on the second motion. The speed information and the second motion route determine the second time when the second virtual character moves to the predicted collision position;
若所述第一时间与所述第二时间之间的时间差小于预设时间阈值,确定所述第一虚拟角色与所述第二虚拟角色之间在所述未来预设时间段内存在角色碰撞。If the time difference between the first time and the second time is less than the preset time threshold, it is determined that there is a character collision between the first virtual character and the second virtual character within the future preset time period. .
一种可选的实施方式中,所述避让信息获取模块320具体用于:In an optional implementation, the avoidance information acquisition module 320 is specifically used to:
检测所述第二虚拟角色的路权优先级是否高于所述第一虚拟角色的路权优先级;Detect whether the right-of-way priority of the second virtual character is higher than the right-of-way priority of the first virtual character;
若所述第二虚拟角色的路权优先级高于所述第一虚拟角色的路权优先级,获取所述第一虚拟角色的实体规避半径;If the right-of-way priority of the second virtual character is higher than the right-of-way priority of the first virtual character, obtain the physical avoidance radius of the first virtual character;
基于所述实体规避半径,对所述第一虚拟角色的运动进行调整,得到所述第一虚拟角色的规避信息;Based on the entity avoidance radius, adjust the movement of the first virtual character to obtain avoidance information of the first virtual character;
其中,所述规避信息包括以下信息中的一种或者多种:Wherein, the avoidance information includes one or more of the following information:
避让运动路线;避让运动速度;避让运动方向;避让运动时长。Avoidance movement route; avoidance movement speed; avoidance movement direction; avoidance movement duration.
一种可选的实施方式中,所述避让控制模块330还用于:In an optional implementation, the avoidance control module 330 is also used to:
若所述第二虚拟角色的路权优先级低于所述第一虚拟角色的路权优先级,确定所述第一虚拟角色无需避让,控制所述第一虚拟角色按照所述第一运动信息运动。If the right-of-way priority of the second virtual character is lower than the right-of-way priority of the first virtual character, it is determined that the first virtual character does not need to avoid, and the first virtual character is controlled to follow the first movement information. sports.
一种可选的实施方式中,如图4中所示,当所述第二虚拟角色为玩家角色,并且所述第一虚拟角色的路权优先级高于所述玩家角色的路权优先级时,所述角色碰撞规避装置300还包括物理层绑定模块350,所述物理层绑定模块350用于:In an optional implementation, as shown in Figure 4, when the second virtual character is a player character, and the right-of-way priority of the first virtual character is higher than the right-of-way priority of the player character When , the character collision avoidance device 300 also includes a physical layer binding module 350, and the physical layer binding module 350 is used to:
为所述玩家角色绑定玩家物理层,并为所述第一虚拟角色绑定非玩家物理层;Bind a player physical layer to the player character, and bind a non-player physical layer to the first virtual character;
在检测到所述玩家角色向所述第一虚拟角色运动,并且所述玩家角色和所述第一虚拟角色之间能够发生碰撞时,控制所述玩家物理层和所述非玩家物理层之间彼此挤压,以避免所述玩家角色和所述第一虚拟角色之间的至少部分角色重叠。When it is detected that the player character moves toward the first virtual character and a collision can occur between the player character and the first virtual character, control the relationship between the player physical layer and the non-player physical layer. squeeze each other to avoid at least partial character overlap between the player character and the first avatar.
一种可选的实施方式中,如图4中所示,所述角色碰撞规避装置300还包括近身攻击控制模块360,所述近身攻击控制模块360用于:In an optional implementation, as shown in Figure 4, the character collision avoidance device 300 also includes a close attack control module 360, and the close attack control module 360 is used to:
在所述第一虚拟角色向所述玩家角色运动,并向所述玩家角色施加攻击时,检测所述第一虚拟角色是否为近身攻击所述玩家角色;When the first virtual character moves toward the player character and attacks the player character, detect whether the first virtual character attacks the player character at close range;
若所述第一虚拟角色为近身攻击所述玩家角色,在所述第一虚拟角色攻击所述玩家角色时,控制所述非玩家物理层与所述玩家物理层重叠;If the first virtual character attacks the player character at close range, when the first virtual character attacks the player character, control the non-player physical layer to overlap with the player physical layer;
在所述非玩家物理层与所述玩家物理层发生重叠时,控制所述第一虚拟角色与所述玩家角色部分重叠,以使所述第一虚拟角色完成攻击所述玩家角色。When the non-player physical layer overlaps with the player physical layer, the first virtual character and the player character are controlled to partially overlap, so that the first virtual character completes attacking the player character.
这样,本公开实施例提供的角色碰撞规避装置,可以通过第一虚拟角色的第一运动信息和第二虚拟角色的第二运动信息确定两者存在角色碰撞的情况下,控制第一虚拟角色进行运动规避,以避免两者的碰撞,不仅可以保证虚拟角色控制的精准度和性能,还可以有效避免角色在行动中的碰撞,进而可以有效降低实际场景中角色因碰撞而产生模型穿插的概率,可以在有效保证场景的真实性和可靠性的前提下,使得画面更加逼真。In this way, the character collision avoidance device provided by the embodiment of the present disclosure can control the first virtual character to perform a collision when it is determined through the first motion information of the first virtual character and the second motion information of the second virtual character that there is a character collision between the two. Motion avoidance to avoid collisions between the two can not only ensure the accuracy and performance of virtual character control, but also effectively avoid collisions of characters in action, which can effectively reduce the probability of model interleaving due to collisions in actual scenes. It can make the picture more realistic while effectively ensuring the authenticity and reliability of the scene.
对应于图1中的角色碰撞规避方法,本公开实施例还提供了一种计算机设备500,如图5所示,为本公开实施例提供的计算机设备500结构示意图,包括:处理器510、存储器520、和总线530。所述存储器520存储有所述处理器510可执行的机器可读指令,当计算机设备500运行时,所述处理器510与所述存储器520之间通过总线530通信,所述机器可读指令被所述处理器510执行时可以执行如图1中所示的角色碰撞规避方法的步骤。Corresponding to the character collision avoidance method in Figure 1, an embodiment of the present disclosure also provides a computer device 500. As shown in Figure 5, which is a schematic structural diagram of the computer device 500 provided by an embodiment of the present disclosure, it includes: a processor 510, a memory 520, and bus 530. The memory 520 stores machine readable instructions executable by the processor 510. When the computer device 500 is running, the processor 510 and the memory 520 communicate through the bus 530, and the machine readable instructions are When the processor 510 is executed, the steps of the character collision avoidance method shown in Figure 1 can be performed.
上述指令的具体执行过程可以参考本公开实施例中所述的角色碰撞规避方法的步骤,此处不再赘述。For the specific execution process of the above instructions, please refer to the steps of the character collision avoidance method described in the embodiment of the present disclosure, and will not be described again here.
本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述方法实施例中所述的角色碰撞规避方法的步骤。其中,该存储介质可以是易失性或非易失的计算机可读取存储介质。Embodiments of the present disclosure also provide a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is run by a processor, the steps of the character collision avoidance method described in the above method embodiment are executed. Wherein, the storage medium may be a volatile or non-volatile computer-readable storage medium.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统和装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。在本公开所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,又例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here. In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some communication interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。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 they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in various embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可执行的非易失的计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-OnlyMemory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the existing technology or the 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 are used to cause a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present disclosure. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code.
最后应说明的是:以上所述实施例,仅为本公开的具体实施方式,用以说明本公开的技术方案,而非对其限制,本公开的保护范围并不局限于此,尽管参照前述实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本公开实施例技术方案的精神和范围,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应所述以权利要求的保护范围为准。Finally, it should be noted that the above-mentioned embodiments are only specific implementations of the present disclosure and are used to illustrate the technical solutions of the present disclosure rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although refer to the foregoing The embodiments describe the present disclosure in detail. Those of ordinary skill in the art should understand that any person familiar with the technical field can still modify the technical solutions recorded in the foregoing embodiments within the technical scope disclosed in the present disclosure. Changes may be easily imagined, or equivalent substitutions may be made to some of the technical features; and these modifications, changes or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and shall be included in the present disclosure. within the scope of protection. Therefore, the protection scope of the present disclosure should be determined by the protection scope of the claims.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110093798.9A CN112774204B (en) | 2021-01-22 | 2021-01-22 | Role collision avoidance method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110093798.9A CN112774204B (en) | 2021-01-22 | 2021-01-22 | Role collision avoidance method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112774204A CN112774204A (en) | 2021-05-11 |
CN112774204B true CN112774204B (en) | 2023-10-20 |
Family
ID=75758804
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110093798.9A Active CN112774204B (en) | 2021-01-22 | 2021-01-22 | Role collision avoidance method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112774204B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114259727A (en) * | 2021-12-28 | 2022-04-01 | 完美世界(北京)软件科技发展有限公司 | Control method and device for attackable object, storage medium, computer equipment |
CN114722232B (en) * | 2022-04-18 | 2023-12-12 | 北京航迹科技有限公司 | Method, device, equipment and storage medium for predicting motion trail |
Citations (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007105499A (en) * | 2007-01-09 | 2007-04-26 | Namco Bandai Games Inc | GAME SYSTEM, PROGRAM, AND INFORMATION STORAGE MEDIUM |
CN102663808A (en) * | 2012-02-29 | 2012-09-12 | 中山大学 | Method for establishing rigid body model based on three-dimensional model in digital home entertainment |
CN105031921A (en) * | 2015-02-15 | 2015-11-11 | 北京乐动卓越信息技术有限公司 | Anticollision method and system in game object disordered mobile process |
CN105404511A (en) * | 2015-11-19 | 2016-03-16 | 福建天晴数码有限公司 | Physical collision prediction method and apparatus based on ideal geometry |
CN106215419A (en) * | 2016-07-28 | 2016-12-14 | 腾讯科技(深圳)有限公司 | Collision control method and device |
CN108579085A (en) * | 2018-03-12 | 2018-09-28 | 腾讯科技(深圳)有限公司 | Treating method and apparatus, storage medium and the electronic device of barrier collision |
JP6527993B1 (en) * | 2018-07-23 | 2019-06-12 | 株式会社Cygames | Program, electronic device, method, and system |
CN110180182A (en) * | 2019-04-28 | 2019-08-30 | 腾讯科技(深圳)有限公司 | Collision checking method, device, storage medium and electronic device |
CN110505493A (en) * | 2019-09-04 | 2019-11-26 | 广州华多网络科技有限公司 | Collision checking method, game interaction method and live broadcast system based on game |
CN111467804A (en) * | 2020-04-30 | 2020-07-31 | 网易(杭州)网络有限公司 | Hit processing method and device in game |
CN111494954A (en) * | 2020-04-22 | 2020-08-07 | 网易(杭州)网络有限公司 | Animation processing method and device in game, electronic equipment and storage medium |
CN111569422A (en) * | 2020-05-15 | 2020-08-25 | 网易(杭州)网络有限公司 | Interaction method and device between game characters, electronic equipment and storage medium |
CN111589144A (en) * | 2020-06-24 | 2020-08-28 | 腾讯科技(深圳)有限公司 | Control method, device, equipment and medium of virtual role |
CN111773723A (en) * | 2020-07-29 | 2020-10-16 | 网易(杭州)网络有限公司 | Collision detection method and device |
CN111905369A (en) * | 2020-08-20 | 2020-11-10 | 网易(杭州)网络有限公司 | Display control method and device in game and electronic equipment |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6470796B2 (en) * | 2017-06-12 | 2019-02-13 | 株式会社コロプラ | Information processing method, program, and computer |
-
2021
- 2021-01-22 CN CN202110093798.9A patent/CN112774204B/en active Active
Patent Citations (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007105499A (en) * | 2007-01-09 | 2007-04-26 | Namco Bandai Games Inc | GAME SYSTEM, PROGRAM, AND INFORMATION STORAGE MEDIUM |
CN102663808A (en) * | 2012-02-29 | 2012-09-12 | 中山大学 | Method for establishing rigid body model based on three-dimensional model in digital home entertainment |
CN105031921A (en) * | 2015-02-15 | 2015-11-11 | 北京乐动卓越信息技术有限公司 | Anticollision method and system in game object disordered mobile process |
CN105404511A (en) * | 2015-11-19 | 2016-03-16 | 福建天晴数码有限公司 | Physical collision prediction method and apparatus based on ideal geometry |
CN106215419A (en) * | 2016-07-28 | 2016-12-14 | 腾讯科技(深圳)有限公司 | Collision control method and device |
CN108579085A (en) * | 2018-03-12 | 2018-09-28 | 腾讯科技(深圳)有限公司 | Treating method and apparatus, storage medium and the electronic device of barrier collision |
JP6527993B1 (en) * | 2018-07-23 | 2019-06-12 | 株式会社Cygames | Program, electronic device, method, and system |
CN110180182A (en) * | 2019-04-28 | 2019-08-30 | 腾讯科技(深圳)有限公司 | Collision checking method, device, storage medium and electronic device |
CN110505493A (en) * | 2019-09-04 | 2019-11-26 | 广州华多网络科技有限公司 | Collision checking method, game interaction method and live broadcast system based on game |
CN111494954A (en) * | 2020-04-22 | 2020-08-07 | 网易(杭州)网络有限公司 | Animation processing method and device in game, electronic equipment and storage medium |
CN111467804A (en) * | 2020-04-30 | 2020-07-31 | 网易(杭州)网络有限公司 | Hit processing method and device in game |
CN111569422A (en) * | 2020-05-15 | 2020-08-25 | 网易(杭州)网络有限公司 | Interaction method and device between game characters, electronic equipment and storage medium |
CN111589144A (en) * | 2020-06-24 | 2020-08-28 | 腾讯科技(深圳)有限公司 | Control method, device, equipment and medium of virtual role |
CN111773723A (en) * | 2020-07-29 | 2020-10-16 | 网易(杭州)网络有限公司 | Collision detection method and device |
CN111905369A (en) * | 2020-08-20 | 2020-11-10 | 网易(杭州)网络有限公司 | Display control method and device in game and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN112774204A (en) | 2021-05-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11083969B2 (en) | Adjusting object adaptive modification or game level difficulty and physical gestures through level definition files | |
CN109865286B (en) | Information processing method and device in game and storage medium | |
KR102292931B1 (en) | Device and method to control object | |
WO2018130135A1 (en) | Method and device for controlling way-finding of simulation object, and server | |
US20200206620A1 (en) | Information processing system, storage medium storing information processing program, information processing apparatus, and information processing method | |
CN112807681A (en) | Game control method, device, electronic equipment and storage medium | |
US10610784B2 (en) | Information storage medium and game device | |
KR102648598B1 (en) | Virtual racing car control method and apparatus, storage medium and device | |
JP6713727B2 (en) | Server system | |
CN112774204B (en) | Role collision avoidance method, device, equipment and storage medium | |
JP2023543519A (en) | Virtual item input method, device, terminal, and program | |
CN114870399A (en) | A virtual character movement control method, device, electronic device and storage medium | |
JP5407194B2 (en) | VIDEO GAME DEVICE, VIDEO GAME CONTROL METHOD, VIDEO GAME CONTROL PROGRAM, AND RECORDING MEDIUM | |
WO2025025764A1 (en) | Virtual character match playing method and apparatus, device, medium, and program product | |
CN115814404B (en) | Method, device, equipment and medium for controlling movement of virtual object | |
CN113350795B (en) | A role control method, terminal, device and storage medium | |
JP2015154852A (en) | Game server, game control method, game program, game program recording medium, and game system | |
JP7273319B2 (en) | Game program, game system, and server device | |
JP7406950B2 (en) | Computer systems, server systems and programs | |
JP7575556B2 (en) | Computer system, game system and program | |
JP6170599B1 (en) | Program, control method, and information processing apparatus | |
JP7644869B1 (en) | Information processing system, information processing method, and program | |
US12042730B2 (en) | Pathfinding method, device for a game object, and computer-readable storage medium | |
JP5513671B1 (en) | GAME SERVER, GAME CONTROL METHOD, GAME PROGRAM, RECORDING MEDIUM, AND GAME SYSTEM | |
JP2021062075A (en) | Computer system, server system and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |