WO2021258627A1 - Character climbing method and apparatus, computer program, and computer-readable medium - Google Patents

Character climbing method and apparatus, computer program, and computer-readable medium Download PDF

Info

Publication number
WO2021258627A1
WO2021258627A1 PCT/CN2020/130395 CN2020130395W WO2021258627A1 WO 2021258627 A1 WO2021258627 A1 WO 2021258627A1 CN 2020130395 W CN2020130395 W CN 2020130395W WO 2021258627 A1 WO2021258627 A1 WO 2021258627A1
Authority
WO
WIPO (PCT)
Prior art keywords
obstacle
target character
character
climbing
vector
Prior art date
Application number
PCT/CN2020/130395
Other languages
French (fr)
Chinese (zh)
Inventor
李宁徽
Original Assignee
苏州幻塔网络科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏州幻塔网络科技有限公司 filed Critical 苏州幻塔网络科技有限公司
Publication of WO2021258627A1 publication Critical patent/WO2021258627A1/en

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/56Computing the motion of game characters with respect to other game characters, game objects or elements of the game scene, e.g. for simulating the behaviour of a group of virtual soldiers or for path finding
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/57Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game
    • A63F13/577Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game using determination of contact between game characters or objects, e.g. to avoid collision between virtual racing cars

Definitions

  • the present invention relates to the technical field of game design, and in particular to a character climbing method, device, computer program and computer readable medium.
  • the game developer when the game is designed, the game developer will mark the building that can be climbed in the game, and make a climbing route along the building that can be climbed in the way of dots. In this way, when the player is in the game, Then you can control your character to climb in the game world according to the climbing route designed to realize the exploration of the game world.
  • Climbing routes are generally designed on specific buildings. Only on specific buildings can the player control the character to climb, and the climbing route is also fixed. For areas not involved in the climbing route, the player cannot control the character’s progress. Climbing, the scope of the character's climbing is limited, resulting in distortion of the game and lack of vitality of the character in the game, and the intelligence of the game is poor.
  • the present invention is proposed to provide a character climbing method, device, computer program and computer-readable medium that overcome the above-mentioned problems or at least partially solve or alleviate the above-mentioned problems.
  • a character climbing method including:
  • the speed vector carried by the target character is obtained, and the target character is controlled to climb closely to the obstacle according to the direction of the character and the speed vector.
  • a character climbing device which includes:
  • the determination module is used to determine the obstacles that collide with the target character
  • a transmitting module configured to transmit detection rays to the obstacle based on the target character when it is determined that the obstacle allows interaction and the terrain satisfies climbing conditions to determine at least one wall composing the obstacle;
  • the first calculation module is configured to receive at least one normal vector returned after the detection ray hits the at least one wall, and calculate the character orientation of the target character by using the at least one normal vector;
  • the control module is used to obtain the speed vector carried by the target character, and control the target character to climb closely against the obstacle according to the direction of the character and the speed vector.
  • a computer program comprising computer readable code, which when run on a server, causes the server to execute any one of claims 1-8 The character climbing method described.
  • the target character emits detection rays to the obstacles, determines at least one wall that composes the obstacle, and receives the detection rays.
  • At least one normal vector returned after hitting at least one wall at least one normal vector is used to calculate the character orientation of the target character, and then the speed vector carried by the target character is obtained, and the target character is controlled to climb closely to the obstacle according to the character orientation and speed vector , So that there is no need to set any fixed climbing route on the obstacle, and the continuous ray detection between the target character and the obstacle determines the direction that the target character wants to travel, so as to control the target character to automatically climb on the obstacle.
  • the climbing range of the game will not be restricted, ensuring the authenticity of the game, giving the game character vitality, improving the intelligence of the game, and enhancing the player's game experience.
  • Fig. 1 schematically shows a schematic flow chart of a character climbing method according to an embodiment of the present invention
  • Fig. 2A schematically shows a schematic flow chart of a character climbing method according to an embodiment of the present invention
  • FIG. 2B schematically shows a schematic flowchart of a role climbing method according to an embodiment of the present invention
  • Figure 2C schematically shows a schematic flow chart of a character climbing method according to an embodiment of the present invention
  • Fig. 2D schematically shows a schematic diagram of a character climbing method according to an embodiment of the present invention
  • Figure 2E schematically shows a schematic diagram of a character climbing method according to an embodiment of the present invention
  • Fig. 3A schematically shows a structural diagram of a character climbing device according to an embodiment of the present invention
  • Fig. 3B schematically shows a structural diagram of a character climbing device according to an embodiment of the present invention
  • Fig. 3C schematically shows a structural diagram of a character climbing device according to an embodiment of the present invention
  • Fig. 3D schematically shows a structural diagram of a character climbing device according to an embodiment of the present invention
  • Fig. 3E schematically shows a structural diagram of a character climbing device according to an embodiment of the present invention
  • Fig. 4 schematically shows a block diagram of a server for executing the method according to the present invention.
  • Fig. 5 schematically shows a storage unit for holding or carrying program codes for implementing the method according to the present invention.
  • the embodiment of the present invention provides a role climbing method. As shown in FIG. 1, the method includes:
  • a detection ray is emitted to the obstacle based on the target character to determine at least one wall composing the obstacle.
  • the method provided by the embodiment of the present invention can determine the obstacle that collides with the target character. After the obstacle is identified and determined to allow interaction and the terrain satisfies the climbing condition, the target character emits detection rays to the obstacle to determine at least the component of the obstacle. A wall, and receive at least one normal vector returned by the detection ray after hitting at least one wall, use at least one normal vector to calculate the character orientation of the target character, and then obtain the speed vector carried by the target character, and control the target character according to the character orientation and The speed vector is close to the obstacle for climbing, so that there is no need to set any fixed climbing route on the obstacle.
  • the continuous ray detection between the target character and the obstacle is used to determine the direction the target character wants to travel, thereby controlling the target character automatically Climbing on obstacles, the climbing range of the character will not be restricted, ensuring the authenticity of the game, giving the game character vitality, improving the intelligence of the game, and enhancing the game experience of the player.
  • the embodiment of the present invention provides a role climbing method. As shown in FIG. 2A, the method includes:
  • the present invention proposes a method for character climbing.
  • the method for character climbing it is considered that some obstacles in the game world can be directly pushed, overturned and other interactions are carried out. Therefore, the obstacles The terrain of the obstacle is detected.
  • the obstacle When it is determined that the obstacle is not an obstacle that can be pushed, overturned, or other interactive obstacles, it can be determined that the terrain of the obstacle allows climbing, and the climbing function of the obstacle is provided, and the climbing function is automatically provided.
  • Detect the wall that composes the obstacle determine the shape of the wall of the obstacle, so as to control the character to climb according to the actual situation of the obstacle according to the shape of the wall and the speed vector carried by the character. There is no need to set a climbing route for the obstacle. In the above process, the player can control the character to freely climb on the obstacle, which improves the realism of the game.
  • the player wants to control the character to crawl, the first thing is to trigger the character’s crawling by colliding with obstacles. Therefore, when the player’s target character collides, the obstacle that collides with the target character is determined, so that the follow-up can pass. Obstacles perform a series of tests to determine whether the obstacles can be climbed, and follow the player's instructions to perform climbing operations after determining whether the obstacles can be climbed. Among them, a callback function MoveBlockedBy (obstacle movement) can be set in the game, and based on the callback function, it is determined whether the target character collides with the obstacle, and the following is triggered based on the callback function to detect the terrain of the obstacle.
  • MoveBlockedBy obstacle movement
  • the terrain of the obstacle needs to be identified.
  • the corresponding entity attributes are usually set for each entity, and the entity attributes are used to indicate what kind of object the entity is used for.
  • the determination of whether the obstacle can be climbed is achieved by querying whether the obstacle carries a climbing prohibition mark.
  • querying whether an obstacle carries a climbing prohibition mark if the obstacle does not carry a climbing prohibition mark, it means that the obstacle can be climbed.
  • the obstacles that can be climbed are generally divided into categories. There are two types, one is entities such as mountains, tall buildings, etc., which can provide players with free climbing functions, and the other is virtual ladders, which are also ladders. Generally speaking, ladders The size of is fixed, so that the climbing range that the ladder can provide is also fixed.
  • the target character can only climb along the ladder. Therefore, after confirming that the obstacle can be climbed, the center point of the target character needs to be taken as the starting point , Transmit a detection ray of a preset length in the horizontal direction, and receive a detection result returned by the detection ray, and determine whether the obstacle is a virtual climbing ladder according to the detection result.
  • the detection result shows that the obstacle is a virtual ladder, it means that the target character can only climb along the virtual ladder.
  • the environment created by the virtual ladder does not provide the conditions for free climbing. Therefore, the target character is controlled to follow the virtual ladder's laying trajectory Climb.
  • the detection result shows that the obstacle is not a virtual climbing ladder, it indicates that the obstacle is not a virtual climbing ladder.
  • Fig. 2B it is first determined whether the obstacle can be interacted, and if the obstacle cannot be interacted, the current process is ended. If the obstacle can be interacted, continue to judge whether the obstacle can be pushed. If the obstacle can be pushed, the target character is directly controlled to enter the pushing state, the obstacle is pushed, and the current process is ended. If the obstacle cannot be pushed, continue to judge whether the obstacle can be overturned. If the obstacle can be surmounted, then directly control the target character to enter the surpassing state, surpass the obstacle, and end the current process. If the obstacle cannot be overturned, check whether the obstacle carries a climbing prohibition mark.
  • the obstacle carries a climbing prohibition mark, it means that the obstacle is not allowed to be climbed in the game world, and the current process is ended directly without providing the climbing function. If the obstacle does not carry a climbing prohibition mark, it means that the obstacle can be climbed, and it is necessary to further determine whether the obstacle is a virtual climbing ladder. When it is determined that the obstacle is a virtual ladder, the target character can be directly controlled to climb along the virtual ladder. When it is determined that the obstacle is not a virtual climbing ladder, it is determined that the obstacle can provide a free climbing function, continue to perform other recognition of the obstacle, and control the target character to climb on the obstacle according to the operation of the player.
  • the normal vector of the character relative to the obstacle is different, Only by determining the position of the target character and the normal vector formed by the obstacle can the character orientation of the target character be accurately determined. Therefore, when the terrain of the obstacle is detected to allow climbing, it is necessary to determine at least one wall composing the obstacle, and then Determine the character orientation of the target character.
  • a detection ray may be emitted to the obstacle based on the target character, and the range covered by the obstacle may be determined according to whether the detection ray hits and the content of the detection ray returned after the hit.
  • the target character When determining at least one wall that composes an obstacle, first, control the target character to approach the obstacle.
  • the target character when the target character is controlled to be close to the obstacle, since the player wants the target character to climb on the obstacle, the target character will be controlled by the joystick so that the target character will carry the speed vector. Therefore, the player can first determine the speed vector.
  • the speed vector carried by the target character determines the forward direction of the target character indicated by the speed vector, and then uses the current position of the target character as the starting point to control the target character to collide in the forward direction, and determine the position where the target character collides with the obstacle as the wall Face position, and adjust the target character to the position indicated by the wall position so that the target character is close to the obstacle.
  • the above process of putting the target character close to the obstacle can be realized based on the function MoveAlongVines (walking along the way), in which the target character can be regarded as a player capsule, and the player capsule is the shape.
  • the position of the player's capsule is the starting point, and a collision detection is performed forward according to the instructions of the speed vector to detect the position of the wall of the obstacle, so that the player's capsule can move close to the obstacle.
  • the target character's sub-velocity and the sub-velocity direction indicated by the sub-velocity are determined.
  • the game world is a 3D (Three Dimensions) world.
  • the speed vector of the target character is a three-dimensional variable, that is, the FVector (other vector) in the virtual engine.
  • the speed vector can be decomposed into three The component of the direction. Since the target character needs to be close to the obstacle when climbing, the speed component in the front and rear direction is used in the collision test. Therefore, when determining the character's orientation, the speed in the left and right directions needs to be applied, that is, the target character is indicated by the speed vector.
  • the leftward speed or the rightward speed in the forward direction that is, the partial speed in the embodiment of the present invention, so that subsequent processing and calculation of the partial speed can determine the character orientation of the target character.
  • determining the partial speed project the speed vector on the horizontal line on the right side of the target character's forward direction to obtain the partial speed, and multiply the speed vector by the partial speed to obtain the speed product.
  • the value of the speed product is a positive number
  • the sub-speed direction can be set to the right direction of the forward direction.
  • the value of the speed product is a negative number
  • it is determined that the target character does not have a rightward speed, but has a leftward speed. Therefore, the sub-speed direction is set to the right direction of the forward direction.
  • the detection rays are emitted in the direction of the sub-velocities. If the detection ray hits an obstacle, the hit entity can be directly used as at least one wall. If the detection ray misses the target wall, the detection ray needs to be emitted to the advancing direction, the left side of the advancing direction, and the right side of the advancing direction respectively, and the entity hit by the detection ray is used as at least one wall. Among them, it is determined that at least one wall is divided into multiple possibilities according to whether the detection ray hits the obstacle. Therefore, the multiple possibilities are described separately.
  • the detection process of the entire wall is as follows:
  • the detection ray is emitted in the direction of the sub-velocity.
  • the hit entity can be directly used as at least one wall.
  • the circle represents the target character. If the obstacle is in the shape shown in the figure, the target character can directly detect the wall of the obstacle at the three positions shown in Figure 2D based on the sub-velocity direction. Therefore, it can be further determined that the shape of at least one wall of the obstacle is the shape shown in FIG. The position may be any one of the possibilities shown in FIG. 2D.
  • the character orientation can be determined according to the content returned by the hit detection ray, so as to control the target character to turn.
  • the detection ray does not hit the obstacle, it is necessary to perform multi-directional detection of the target character.
  • the detection ray can be emitted to the left side of the target character's advancing direction. If the detection ray does not hit the obstacle, the detection ray is continuously emitted from the front left of the target character to the right, and when the detection ray hits, it can be directly determined that the hit entity is at least one wall.
  • the left side does not hit, indicating that the left side of the target character is not occluded, but there is occlusion during the process of moving and emitting detection rays, which can be inferred from obstacles.
  • At least one of the walls may have the shape shown in Figure 2E, that is, the U-shaped wall facing outwards, and the relative position of the target character and at least one of the walls is the first possibility.
  • the detection ray of the hit can be The returned content determines the direction of the character in order to control the target character to turn.
  • the hit entity can be used as the left wall of the obstacle, record the left wall, and then move towards the target character’s forward direction.
  • the right side emits detection rays to determine whether there is a right side wall.
  • the detection ray is continuously emitted to the right from the front left of the target character, there is also a possibility that no entity will be hit. Therefore, if the detection ray is continuously emitted from the front left of the target character to the right, no life is emitted. , The detection ray is also emitted to the right side of the target character's forward direction to determine whether there is a right side wall.
  • the hit entity After launching the detection ray to the right side of the target character's forward direction, if the detection ray hits the entity, the hit entity can be used as the right wall of the obstacle, record the right wall, and continue to the target character The detection beam is emitted in the middle direction. If the detection ray emitted to the right side of the target character's forward direction fails to hit, the detection ray needs to be continuously emitted from the front right of the target character to the left, and when the detection ray hits, it can be directly determined that the hit entity is at least one wall noodle.
  • At least one of the walls may be the shape shown in Figure 2E, that is, the U-shaped wall facing outwards, and the relative position of the target character and at least one of the walls is the third possibility. In this way, the detection ray of the hit can be followed
  • the returned content determines the direction of the character in order to control the target character to turn.
  • the detection ray continues to be emitted from the front right of the target character to the left, but no life is being emitted, the right wall must be cleared, and the detection ray must start to be emitted toward the middle of the target character to the front.
  • the detection ray was also emitted to the middle of the target character and forward. If the detection ray is emitted to the middle of the target character and does not come forward, the vector in the middle is cleared, and the character's orientation is calculated based on the content returned by the detection ray hit in the above process.
  • the detection ray is emitted to the middle of the target character and forward, it can be determined that the relative position of the target character and at least one wall is the second possibility shown in FIG. 2E, and the content returned by the hit detection ray is received. Then determine the character orientation of the target character.
  • At least one wall that composes the obstacle can be determined, and then the normal vector between the target character and the at least one wall can be determined by the relative position of the at least one wall and the target character, so that according to the normal vector Accurately calculate the character orientation of the target character.
  • the above process of determining at least one wall can be implemented by the function UpdateVinesInfo (update route information), through which the target character can be controlled to emit detection rays directly to the obstacles in every frame of the game world and directly based on Detect the hit of the ray on the obstacle, and generate at least one normal vector.
  • the obstacle composed of at least one wall may have various shapes, and the relative position of the target character and the at least one wall may have many possibilities, therefore, it is necessary to determine the current tightness of the target character.
  • the normal vector formed by the position where the obstacle is located and at least one wall surface is then used to calculate the character orientation of the target character based on the normal vector.
  • the detection rays from the target character to the obstacle in step 204 are all emitted horizontally, when the detection rays hit at least one wall, the normal vector formed by the target character and the wall can be directly determined.
  • At least one normal vector returned by the detection ray after hitting at least one wall can be received, and the at least one normal vector can be used to calculate the character orientation of the target character.
  • the detection rays will be sent to the left, middle and right sides of the target character respectively.
  • at least one normal vector in a different orientation will be returned.
  • So at least one normal vector can be divided into left normal vector, middle normal vector and right normal vector.
  • the left normal vector can be represented by Left Vines Normal (left normal vector)
  • the middle normal vector can be represented by Middle Vines Normal (middle normal vector)
  • the right normal vector can be represented by Right Vines Normal (right normal vector).
  • the target character since the target character carries the speed vector conveyed by the player through the joystick to control the target character, after the character orientation of the target character is determined, the speed vector carried by the target character can be obtained to control the target character Climb closely to the obstacle according to the character's orientation and speed vector.
  • the position of the target character relative to the obstacle is constantly changing over time, and the speed vector issued by the player in the control of the target character may also vary from time to time.
  • the player’s wishes are constantly changing. Therefore, in order to ensure that the target character’s behavior in the game world can accurately follow the player’s operation, the process shown in steps 201 to 205 above needs to be performed in each frame of the game. Perform detection and determine the character orientation of the target character, and then control the target character to act in accordance with the player's real-time operation.
  • the target character climbs obstacles in the game there are two situations in which the target character climbs obstacles in the game, one is climbing downwards and the other is climbing upwards. If the target character climbs downwards, when it is determined that the target character climbs to a walkable ground, control the target character to exit the climbing state. If the target character climbs upwards, when it is determined that the target character climbs to the top of the obstacle, control the target character to climb over the top of the obstacle and exit the climbing state.
  • the above process describes the climbing process triggered by the target character walking to the obstacle and colliding with the obstacle.
  • the function of climbing and jumping is also provided, that is, the player can use the shaking
  • the rod controls the target character to climb and jump, so that the target character jumps to a certain height, is mounted on a certain height of an obstacle, and then climbs up or down from a certain height.
  • the player may also control the target character to climb and jump back during the game, that is, to jump in the opposite direction of the current target character's character.
  • the environment where the player is climbing is an outdoor rainy day.
  • the method provided by the embodiment of the present invention can determine the obstacle that collides with the target character. After the obstacle is identified and determined to allow interaction and the terrain satisfies the climbing condition, the target character emits detection rays to the obstacle to determine at least the component of the obstacle. A wall, and receive at least one normal vector returned by the detection ray after hitting at least one wall, use at least one normal vector to calculate the character orientation of the target character, and then obtain the speed vector carried by the target character, and control the target character according to the character orientation and The speed vector is close to the obstacle for climbing, so that there is no need to set any fixed climbing route on the obstacle.
  • the continuous ray detection between the target character and the obstacle is used to determine the direction the target character wants to travel, thereby controlling the target character automatically Climbing on obstacles, the climbing range of the character will not be restricted, ensuring the authenticity of the game, giving the game character vitality, improving the intelligence of the game, and enhancing the game experience of the player.
  • an embodiment of the present invention provides a character climbing device.
  • the device includes: a determination module 301, a transmission module 302, and a first calculation module 303 And control module 304.
  • the determining module 301 is used to determine obstacles that collide with the target character
  • the transmitting module 302 is configured to transmit detection rays to the obstacle based on the target character when it is determined that the obstacle allows interaction and the terrain satisfies climbing conditions to determine at least one wall composing the obstacle;
  • the first calculation module 303 is configured to receive at least one normal vector returned by the detection ray after hitting the at least one wall, and use the at least one normal vector to calculate the character orientation of the target character;
  • the control module 304 is configured to obtain a speed vector carried by the target character, and control the target character to climb closely against the obstacle according to the character's orientation and the speed vector.
  • the device further includes: a first acquisition module 305, a first detection module 306, and a query module 307.
  • the first obtaining module 305 is configured to obtain the physical attributes of the obstacle
  • the first detection module 306 is configured to detect whether the obstacle is allowed to be pushed and whether it is allowed to be overturned when the physical attribute of the obstacle indicates that the obstacle is allowed to interact;
  • the query module 307 is configured to query whether the obstacle carries a climbing prohibition mark if it is detected that the obstacle is not allowed to be pushed and not allowed to be overturned;
  • the transmitting module 302 is also configured to, if the obstacle does not carry the climbing prohibition mark, use the center point of the target character as the starting point, transmit a detection ray of a preset length in the horizontal direction, and receive the The detection result returned by the detection ray;
  • the control module 304 is further configured to control the target character to climb along the laying trajectory of the virtual ladder when the detection result shows that the obstacle is a virtual ladder;
  • the transmitting module 302 is also used for identifying and determining that the obstacle allows interaction and the terrain satisfies the climbing condition when the detection result shows that the obstacle is not the virtual climbing ladder.
  • the device further includes: a pushing module 308 and a flipping module 309.
  • the pushing module 308 is used to adjust the target character to a pushing state when it is detected that the obstacle is allowed to be pushed, control the target character to push the obstacle, and omit the detection of whether the obstacle is allowed to be overturned process;
  • the overturning module 309 is used to detect whether the obstacle is allowed to be overturned when it is detected that the obstacle is not allowed to be pushed over, and when it is determined that the obstacle is allowed to be overturned, adjust the target character to the overturning state, and control The target character climbs over the obstacle.
  • the transmitting module 302 includes: a control unit 3021, a first determining unit 3022, a transmitting unit 3023, and a second determining unit 3024.
  • the control unit 3021 is used to control the target character to approach the obstacle
  • the first determining unit 3022 is configured to determine, based on the velocity vector, the sub-velocity of the target character and the sub-velocity direction indicated by the sub-velocity, where the sub-velocity is indicated by the target character in the velocity vector Left or right speed in the forward direction;
  • the emitting unit 3023 is used to emit detection rays in the sub-velocity direction
  • the second determining unit 3024 is configured to use the hit entity as the at least one wall surface if the detection ray hits the obstacle;
  • the second determining unit 3024 is further configured to transmit the detection to the forward direction, the left side of the forward direction, and the right side of the forward direction if the detection ray misses the target wall surface. Ray, and the entity hit by the detection ray is used as the at least one wall surface.
  • control unit 3021 is used to determine the forward direction of the target character indicated by the speed vector; taking the current position of the target character as a starting point, control the target character to move in the forward direction A collision is performed, and the position where the target character collides with the obstacle is determined as the wall position; the target character is adjusted to the position indicated by the wall position, and is close to the obstacle.
  • the first determining unit 3022 is configured to project the velocity vector on the horizontal line on the right side of the target character's forward direction to obtain the sub-velocity; compare the velocity vector with the Multiply the partial speeds to obtain the speed product; when the value of the speed product is a positive number, the direction of the partial speed is set to the right of the forward direction; when the value of the speed product is a negative number, The sub-speed direction is set to the right of the forward direction.
  • the first calculation module 303 is used to calculate the first vector sum of the at least one normal vector, normalize the first vector sum to obtain the standard vector sum; perform the standard vector sum In the inversion operation, the inverted standard vector and the indicated direction are used as the character orientation.
  • the device further includes: a second acquisition module 310 and a second calculation module 311.
  • the second acquiring module 310 is configured to acquire the to-be-turned speed vector input by the player to the target character when it is detected that the player controls the target character to turn;
  • the second calculation module 311 is configured to calculate the vector difference between the speed vector to be steered and the speed vector, and use the direction indicated by the vector difference as the direction to be steered;
  • the control module 304 is also used to control the transition from the target character to the direction to be turned.
  • the device provided by the embodiment of the present invention can determine the obstacle that collides with the target character, and when the obstacle is identified and determined to allow interaction and the terrain satisfies the climbing conditions, the target character emits detection rays to the obstacle to determine at least the component of the obstacle A wall, and receive at least one normal vector returned by the detection ray after hitting at least one wall, use at least one normal vector to calculate the character orientation of the target character, and then obtain the speed vector carried by the target character, and control the target character according to the character orientation and The speed vector is close to the obstacle for climbing, so that there is no need to set any fixed climbing route on the obstacle.
  • the continuous ray detection between the target character and the obstacle is used to determine the direction the target character wants to travel, thereby controlling the target character automatically Climbing on obstacles, the climbing range of the character will not be restricted, ensuring the authenticity of the game, giving the game character vitality, improving the intelligence of the game, and enhancing the game experience of the player.
  • the various component embodiments of the present invention may be implemented by hardware, or by software modules running on one or more processors, or by a combination of them.
  • a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all components of the character climbing device according to the embodiment of the present invention.
  • DSP digital signal processor
  • the present invention can also be implemented as a device or device program (for example, a computer program and a computer program product) for executing part or all of the methods described herein.
  • Such a program for realizing the present invention may be stored on a computer-readable medium, or may have the form of one or more signals.
  • Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
  • FIG. 4 shows a server, such as an application server, that can implement the role climbing according to the present invention.
  • the server traditionally includes a processor 410 and a computer program product in the form of a memory 420 or a computer-readable medium.
  • the memory 420 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the memory 420 has a storage space 430 for executing the program code 431 of any method step in the foregoing method.
  • the storage space 430 for program codes may include various program codes 431 respectively used to implement various steps in the above method. These program codes can be read from or written into one or more computer program products.
  • Such computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks.
  • Such a computer program product is usually a portable or fixed storage unit as described with reference to FIG. 5.
  • the storage unit may have storage segments, storage space, etc. arranged similarly to the storage 420 in the server of FIG. 4.
  • the program code can be compressed in a suitable form, for example.
  • the storage unit includes computer-readable codes 431', that is, codes that can be read by, for example, a processor such as 410, which, when run by a server, causes the server to perform the steps in the method described above.

Abstract

A character climbing method and apparatus, a computer program, and a computer-readable medium. The method comprises: determining an obstacle in collision with a target character (101); upon identifying to determine that the obstacle is allowed for interaction and the terrain satisfies a climbing condition, emitting a detection ray to the obstacle on the basis of the target character, and determining at least one wall surface constituting the obstacle (102); receiving at least one normal vector returned by the detection ray after hitting the at least one wall surface, and using the at least one normal vector to calculate a character orientation of the target character (103); and obtaining a speed vector carried by the target character, and controlling the target character to climb against the obstacle according to the character orientation and the speed vector (104). The detection ray is emitted to the obstacle, the normal vector returned by the detection ray after hitting the obstacle is received, and the character orientation is calculated; and the climbing is performed, without needing to set a route and without limiting the range of climbing, thereby ensuring the authenticity of a game, giving the vitality to characters, and enhancing the game experience of players.

Description

角色攀爬方法、装置、计算机程序及计算机可读介质Character climbing method, device, computer program and computer readable medium
本申请要求与2020年6月22日提交中国专利局、申请号为202010573843.6、申请名称为“角色攀爬方法、装置、计算机设备及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。This application claims the priority of the Chinese patent application filed on June 22, 2020 with the Chinese Patent Office, the application number is 202010573843.6, and the application name is "role climbing method, device, computer equipment and readable storage medium", and its entire content Incorporated in the application by reference.
技术领域Technical field
本发明涉及游戏设计技术领域,尤其涉及一种角色攀爬方法、装置、计算机程序及计算机可读介质。The present invention relates to the technical field of game design, and in particular to a character climbing method, device, computer program and computer readable medium.
背景技术Background technique
随着生活水平的提高,人们的生存质量和生活环境发生了翻天覆地的变化,大规模的城市建设,给人们的生活带来高品质享受的同时,也带来了巨大的压力,人们在压力环境下容易出现焦虑、精神不集中、工作无法正常完成等问题,因此,很多可以用于缓解疲劳的游戏应运而生。近年来,游戏设计技术飞速发展,为了更好的游戏体验,游戏开发人员对游戏的要求也越来越高,现在市面上的很多游戏都十分注重玩家在游戏时与游戏世界中的地形、建筑等的交互,所以在游戏中增加了角色的攀爬、翻越等功能,使得游戏的玩法增加,玩家可以体会别样的游戏感受。With the improvement of living standards, people’s quality of life and living environment have undergone earth-shaking changes. While large-scale urban construction has brought high-quality enjoyment to people’s lives, it has also brought tremendous pressure. People are in a stressful environment. Problems such as anxiety, lack of concentration, and inability to complete work normally occur when downloading. Therefore, many games that can be used to relieve fatigue have emerged. In recent years, game design technology has developed rapidly. In order to have a better game experience, game developers have become more and more demanding on games. Many games on the market now pay much attention to the terrain and buildings in the game world during the game. Therefore, functions such as climbing and overturning are added to the game, which increases the gameplay and allows players to experience a different kind of game experience.
相关技术中,游戏在设计时,游戏开发人员会在游戏中对可以攀爬的建筑进行标记,并以打点的方式,沿着可以攀爬的建筑制作攀爬路线,这样,玩家在游戏时,便可以控制自己的角色在游戏世界中按照设计的攀爬路线进行攀爬,实现对游戏世界的探索。In related technologies, when the game is designed, the game developer will mark the building that can be climbed in the game, and make a climbing route along the building that can be climbed in the way of dots. In this way, when the player is in the game, Then you can control your character to climb in the game world according to the climbing route designed to realize the exploration of the game world.
在实现本发明的过程中,发明人发现相关技术至少存在以下问题:In the process of implementing the present invention, the inventor found that the related technology has at least the following problems:
攀爬路线一般设计在特定的建筑物上,只有在特定的建筑物上玩家才能控制角色进行攀爬,而且攀爬路线也是固定的,对于攀爬路线没有涉及到的区域,玩家无法控制角色进行攀爬,角色攀爬的范围受到局限,导致游戏失真且游戏的角色缺乏生命力,游戏的智能性较差。Climbing routes are generally designed on specific buildings. Only on specific buildings can the player control the character to climb, and the climbing route is also fixed. For areas not involved in the climbing route, the player cannot control the character’s progress. Climbing, the scope of the character's climbing is limited, resulting in distortion of the game and lack of vitality of the character in the game, and the intelligence of the game is poor.
发明内容Summary of the invention
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决或者减缓上述问题的角色攀爬方法、装置、计算机程序及计算机可读介质。In view of the above-mentioned problems, the present invention is proposed to provide a character climbing method, device, computer program and computer-readable medium that overcome the above-mentioned problems or at least partially solve or alleviate the above-mentioned problems.
根据本发明的一个方面,提供了一种角色攀爬方法,该方法包括:According to one aspect of the present invention, a character climbing method is provided, the method including:
确定与目标角色发生碰撞的障碍物;Determine the obstacles that collide with the target character;
在识别确定所述障碍物允许交互且地形满足攀爬条件下,基于所述目标角色向所述障碍物发射检测射线,确定组成所述障碍物的至少一个墙面;When it is determined that the obstacle allows interaction and the terrain satisfies climbing conditions, transmitting detection rays to the obstacle based on the target character to determine at least one wall that composes the obstacle;
接收所述检测射线在命中所述至少一个墙面后返回的至少一个法向量,采用所述至少一个法向量计算所述目标角色的角色朝向;Receiving at least one normal vector returned by the detection ray after hitting the at least one wall, and calculating the character orientation of the target character by using the at least one normal vector;
获取所述目标角色携带的速度向量,控制所述目标角色按照所述角色朝向以及所述速度向量紧贴所述障碍物进行攀爬。The speed vector carried by the target character is obtained, and the target character is controlled to climb closely to the obstacle according to the direction of the character and the speed vector.
根据本发明的另一个方面,提供了一种角色攀爬装置,该装置包括:According to another aspect of the present invention, there is provided a character climbing device, which includes:
确定模块,用于确定与目标角色发生碰撞的障碍物;The determination module is used to determine the obstacles that collide with the target character;
发射模块,用于在识别确定所述障碍物允许交互且地形满足攀爬条件下,基于所述目标角色向所述障碍物发射检测射线,确定组成所述障碍物的至少一个墙面;A transmitting module, configured to transmit detection rays to the obstacle based on the target character when it is determined that the obstacle allows interaction and the terrain satisfies climbing conditions to determine at least one wall composing the obstacle;
第一计算模块,用于接收所述检测射线在命中所述至少一个墙面后返回的至少一个法向量,采用所述至少一个法向量计算所述目标角色的角色朝向;The first calculation module is configured to receive at least one normal vector returned after the detection ray hits the at least one wall, and calculate the character orientation of the target character by using the at least one normal vector;
控制模块,用于获取所述目标角色携带的速度向量,控制所述目标角色按照所述角色朝向以及所述速度向量紧贴所述障碍物进行攀爬。The control module is used to obtain the speed vector carried by the target character, and control the target character to climb closely against the obstacle according to the direction of the character and the speed vector.
根据本发明的又一个方面,提供了一种计算机程序,其包括计算机可读代码,当所述计算机可读代码在服务器上运行时,导致所述服务器执行根据权利要求1-8中的任一个所述的角色攀爬方法。According to yet another aspect of the present invention, there is provided a computer program comprising computer readable code, which when run on a server, causes the server to execute any one of claims 1-8 The character climbing method described.
根据本发明的再一个方面,提供了一种计算机可读介质,其中存储了如权利要求11所述的计算机程序。According to another aspect of the present invention, there is provided a computer readable medium in which the computer program according to claim 11 is stored.
本发明的有益效果为:The beneficial effects of the present invention are:
确定与目标角色发生碰撞的障碍物,在识别确定障碍物允许交互且地形满足攀爬条件下,基于目标角色向障碍物发射检测射线,确定组成障碍物的至少一个墙面,并接收检测射线在命中至少一个墙面后返回的至少一个法向量,采用至少一个法向量计算目标角色的角色朝向,进而获取目标角色携带的速度向量,控制目标角色按照角色朝向以及速度向量紧贴障碍物进行攀爬,使得障碍物上无需设置任何固定的攀爬路线,通过目标角色与障碍物之间持续进行射线检测来确定目标角色想要行进的方向,从而控制目标角色自 动在障碍物上进行攀爬,角色的攀爬范围不会受到限制,保证游戏的真实性,赋予游戏角色生命力,提高了游戏的智能性,增强玩家的游戏体验。Determine the obstacles that collide with the target character. After the obstacles are identified and determined to allow interaction and the terrain meets the climbing conditions, the target character emits detection rays to the obstacles, determines at least one wall that composes the obstacle, and receives the detection rays. At least one normal vector returned after hitting at least one wall, at least one normal vector is used to calculate the character orientation of the target character, and then the speed vector carried by the target character is obtained, and the target character is controlled to climb closely to the obstacle according to the character orientation and speed vector , So that there is no need to set any fixed climbing route on the obstacle, and the continuous ray detection between the target character and the obstacle determines the direction that the target character wants to travel, so as to control the target character to automatically climb on the obstacle. The climbing range of the game will not be restricted, ensuring the authenticity of the game, giving the game character vitality, improving the intelligence of the game, and enhancing the player's game experience.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to understand the technical means of the present invention more clearly, it can be implemented in accordance with the content of the specification, and in order to make the above and other objectives, features and advantages of the present invention more obvious and easy to understand. In the following, specific embodiments of the present invention will be cited.
附图说明Description of the drawings
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:By reading the detailed description of the preferred embodiments below, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only used for the purpose of illustrating the preferred embodiments, and are not considered as a limitation to the present invention. Also, throughout the drawings, the same reference symbols are used to denote the same components. In the attached picture:
图1示意性示出了根据本发明一个实施例的角色攀爬方法流程示意图;Fig. 1 schematically shows a schematic flow chart of a character climbing method according to an embodiment of the present invention;
图2A示意性示出了根据本发明一个实施例的角色攀爬方法流程示意图;Fig. 2A schematically shows a schematic flow chart of a character climbing method according to an embodiment of the present invention;
图2B示意性示出了根据本发明一个实施例的角色攀爬方法流程示意图;FIG. 2B schematically shows a schematic flowchart of a role climbing method according to an embodiment of the present invention;
图2C示意性示出了根据本发明一个实施例的角色攀爬方法流程示意图;Figure 2C schematically shows a schematic flow chart of a character climbing method according to an embodiment of the present invention;
图2D示意性示出了根据本发明一个实施例的角色攀爬方法的示意图;Fig. 2D schematically shows a schematic diagram of a character climbing method according to an embodiment of the present invention;
图2E示意性示出了根据本发明一个实施例的角色攀爬方法的示意图;Figure 2E schematically shows a schematic diagram of a character climbing method according to an embodiment of the present invention;
图3A示意性示出了根据本发明一个实施例的角色攀爬装置的结构示意图;Fig. 3A schematically shows a structural diagram of a character climbing device according to an embodiment of the present invention;
图3B示意性示出了根据本发明一个实施例的角色攀爬装置的结构示意图;Fig. 3B schematically shows a structural diagram of a character climbing device according to an embodiment of the present invention;
图3C示意性示出了根据本发明一个实施例的角色攀爬装置的结构示意图;Fig. 3C schematically shows a structural diagram of a character climbing device according to an embodiment of the present invention;
图3D示意性示出了根据本发明一个实施例的角色攀爬装置的结构示意图;Fig. 3D schematically shows a structural diagram of a character climbing device according to an embodiment of the present invention;
图3E示意性示出了根据本发明一个实施例的角色攀爬装置的结构示意图;Fig. 3E schematically shows a structural diagram of a character climbing device according to an embodiment of the present invention;
图4示意性地示出了用于执行根据本发明的方法的服务器的框图;以及Fig. 4 schematically shows a block diagram of a server for executing the method according to the present invention; and
图5示意性地示出了用于保持或者携带实现根据本发明的方法的程序代码的存储单元。Fig. 5 schematically shows a storage unit for holding or carrying program codes for implementing the method according to the present invention.
具体实施例Specific embodiment
下面结合附图和具体的实施方式对本发明作进一步的描述。The present invention will be further described below in conjunction with the drawings and specific embodiments.
本发明实施例提供了一种角色攀爬方法,如图1所示,该方法包括:The embodiment of the present invention provides a role climbing method. As shown in FIG. 1, the method includes:
101、确定与目标角色发生碰撞的障碍物。101. Determine the obstacle that collides with the target character.
102、在识别确定障碍物允许交互且地形满足攀爬条件下,基于目标角色向障碍物发射检测射线,确定组成障碍物的至少一个墙面。102. After the obstacle is identified and determined to allow interaction and the terrain satisfies the climbing condition, a detection ray is emitted to the obstacle based on the target character to determine at least one wall composing the obstacle.
103、接收检测射线在命中至少一个墙面后返回的至少一个法向量,采用至少一个法向量计算目标角色的角色朝向。103. Receive at least one normal vector returned by the detection ray after hitting at least one wall, and use the at least one normal vector to calculate the character orientation of the target character.
104、获取目标角色携带的速度向量,控制目标角色按照角色朝向以及速度向量紧贴障碍物进行攀爬。104. Obtain the speed vector carried by the target character, and control the target character to climb closely to the obstacle according to the direction of the character and the speed vector.
本发明实施例提供的方法,可以确定与目标角色发生碰撞的障碍物,在识别确定障碍物允许交互且地形满足攀爬条件下,基于目标角色向障碍物发射检测射线,确定组成障碍物的至少一个墙面,并接收检测射线在命中至少一个墙面后返回的至少一个法向量,采用至少一个法向量计算目标角色的角色朝向,进而获取目标角色携带的速度向量,控制目标角色按照角色朝向以及速度向量紧贴障碍物进行攀爬,使得障碍物上无需设置任何固定的攀爬路线,通过目标角色与障碍物之间持续进行射线检测来确定目标角色想要行进的方向,从而控制目标角色自动在障碍物上进行攀爬,角色的攀爬范围不会受到限制,保证游戏的真实性,赋予游戏角色生命力,提高了游戏的智能性,增强玩家的游戏体验。The method provided by the embodiment of the present invention can determine the obstacle that collides with the target character. After the obstacle is identified and determined to allow interaction and the terrain satisfies the climbing condition, the target character emits detection rays to the obstacle to determine at least the component of the obstacle. A wall, and receive at least one normal vector returned by the detection ray after hitting at least one wall, use at least one normal vector to calculate the character orientation of the target character, and then obtain the speed vector carried by the target character, and control the target character according to the character orientation and The speed vector is close to the obstacle for climbing, so that there is no need to set any fixed climbing route on the obstacle. The continuous ray detection between the target character and the obstacle is used to determine the direction the target character wants to travel, thereby controlling the target character automatically Climbing on obstacles, the climbing range of the character will not be restricted, ensuring the authenticity of the game, giving the game character vitality, improving the intelligence of the game, and enhancing the game experience of the player.
本发明实施例提供了一种角色攀爬方法,如图2A所示,该方法包括:The embodiment of the present invention provides a role climbing method. As shown in FIG. 2A, the method includes:
201、确定与目标角色发生碰撞的障碍物。201. Determine obstacles that collide with the target character.
发明人认识到,目前的很多游戏中都增加了角色的攀爬功能,为了实现这个攀爬功能,游戏的开发人员在特定的建筑物上设置了特定的攀爬路线, 玩家在游戏世界中只能控制自己的角色在这些特定的建筑物上攀爬,而且只能沿着攀爬路线进行攀爬,这就导致玩家在游戏世界中的行动受到限制,玩家无法控制角色自由的探索游戏世界。为了解决上述问题,本发明提出了一种角色攀爬的方法,在实现该角色攀爬方法时,考虑到游戏世界中有些障碍物是可以直接推动、翻越以及进行其他交互的,因此,对障碍物的地形进行检测,当确定该障碍物不是可以推动、翻越以及进行其他交互的障碍物时,就可以确定该障碍物的地形允许进行攀爬,便提供对障碍物的攀爬功能,且自动检测组成障碍物的墙面,确定障碍物的墙面形状,以便按照墙面形状以及角色携带的速度向量,控制角色按照障碍物的实际情况进行攀爬,无需为障碍物设置攀爬路线,通过上述的过程,玩家可以控制角色自由在障碍物上攀爬,提高了游戏的真实性。The inventor realized that many current games have added the climbing function of characters. In order to realize this climbing function, the game developers set up specific climbing routes on specific buildings, and the players only Can control their own characters to climb on these specific buildings, and can only climb along the climbing route, which causes the player's actions in the game world to be restricted, and the player cannot control the character to freely explore the game world. In order to solve the above problems, the present invention proposes a method for character climbing. When implementing the method for character climbing, it is considered that some obstacles in the game world can be directly pushed, overturned and other interactions are carried out. Therefore, the obstacles The terrain of the obstacle is detected. When it is determined that the obstacle is not an obstacle that can be pushed, overturned, or other interactive obstacles, it can be determined that the terrain of the obstacle allows climbing, and the climbing function of the obstacle is provided, and the climbing function is automatically provided. Detect the wall that composes the obstacle, determine the shape of the wall of the obstacle, so as to control the character to climb according to the actual situation of the obstacle according to the shape of the wall and the speed vector carried by the character. There is no need to set a climbing route for the obstacle. In the above process, the player can control the character to freely climb on the obstacle, which improves the realism of the game.
而玩家在希望控制角色进行爬行时,首先就是需要通过与障碍物进行碰撞来触发角色的爬行,因此,当玩家的目标角色发生碰撞时,确定与目标角色发生碰撞的障碍物,以便后续通过对障碍物进行一系列的检测,确定障碍物是否可以进行攀爬以及在确定可以攀爬后按照玩家的指示进行攀爬操作。其中,游戏中可以设置回调函数MoveBlockedBy(障碍移动),基于该回调函数确定目标角色是否与障碍物发生碰撞,并基于该回调函数实现触发下述对障碍物的地形进行检测。When the player wants to control the character to crawl, the first thing is to trigger the character’s crawling by colliding with obstacles. Therefore, when the player’s target character collides, the obstacle that collides with the target character is determined, so that the follow-up can pass. Obstacles perform a series of tests to determine whether the obstacles can be climbed, and follow the player's instructions to perform climbing operations after determining whether the obstacles can be climbed. Among them, a callback function MoveBlockedBy (obstacle movement) can be set in the game, and based on the callback function, it is determined whether the target character collides with the obstacle, and the following is triggered based on the callback function to detect the terrain of the obstacle.
202、对障碍物进行识别。202. Recognize obstacles.
在本发明实施例中,当确定了障碍物后,考虑到游戏世界中有些障碍物是可以直接推动、翻越以及进行其他交互的,因此,需要对障碍物的地形进行识别。其中,由于在游戏中为了可以对游戏世界中的实体进行区分以及集成管理,通常会为每个实体设置与其对应的实体属性,用该实体属性来指示实体是哪种物体是用来做什么的是否可以与角色进行交互等等,因此,可以利用游戏世界中实体对应的实体属性,对障碍物进行一个大致的识别,也即获取障碍物的实体属性,当障碍物的实体属性指示障碍物允许交互时,表明该障碍物是可以与目标角色进行推动、翻越、攀爬中任一种交互的,而推动以及翻越都是具有固定的执行模式的,所以,进一步地,需要识别障碍物是否允许推动以及是否允许翻越。若识别到障碍物允许推动,则将目标角色调 整至推动状态,控制目标角色推动障碍物即可,也无需执行下述识别障碍物是否允许翻越以及是否可以攀爬的过程。若识别到障碍物不允许推动,则继续识别障碍物是否允许翻越,并在确定障碍物允许翻越时,将目标角色调整至翻越状态,控制目标角色翻越障碍物,也无需执行下述识别障碍物是否允许攀爬的过程。In the embodiment of the present invention, after the obstacle is determined, considering that some obstacles in the game world can be directly pushed, overturned, and other interactions are performed, therefore, the terrain of the obstacle needs to be identified. Among them, in order to distinguish and integrate the management of entities in the game world in the game, the corresponding entity attributes are usually set for each entity, and the entity attributes are used to indicate what kind of object the entity is used for. Whether it can interact with the character, etc., therefore, you can use the entity attributes corresponding to the entities in the game world to make a rough identification of the obstacles, that is, to obtain the entity attributes of the obstacles, when the entity attributes of the obstacles indicate that the obstacles are allowed When interacting, it indicates that the obstacle can interact with the target character in any of pushing, overturning, and climbing, and pushing and overturning all have a fixed execution mode. Therefore, further, it is necessary to identify whether the obstacle is allowed Push and whether to allow over. If it is recognized that the obstacle is allowed to be pushed, adjust the target character to the push state and control the target character to push the obstacle, and there is no need to perform the following process of identifying whether the obstacle is allowed to be overturned and whether it can be climbed. If it is recognized that the obstacle is not allowed to be pushed, continue to identify whether the obstacle is allowed to be overturned, and when it is determined that the obstacle is allowed to be overturned, adjust the target character to the overturn state, and control the target character to climb over the obstacle. There is no need to perform the following identification of obstacles Whether to allow climbing process.
而若识别到障碍物不允许推动且不允许翻越,则需要继续确定该障碍物是否可以攀爬,确定是否可以攀爬是通过查询障碍物是否携带禁止攀爬标记实现的。在查询障碍物是否携带禁止攀爬标记时,若查询到障碍物未携带禁止攀爬标记,则表示该障碍物是可以进行攀爬的,而在游戏世界中,可以攀爬的障碍物一般分为两种类型,一种是诸如山、高楼等的实体,这种实体是可以为玩家提供自由攀爬的功能的,而另一种是虚拟爬梯,虚拟爬梯也就是梯子,一般来说,梯子的大小是固定的,使得梯子可以提供的攀爬范围也是固定的,目标角色只能沿着梯子进行攀爬,所以,在确定障碍物可以进行攀爬后,需要以目标角色的中心点为起点,向水平方向发射预设长度的检测射线,并接收检测射线返回的检测结果,根据该检测结果确定该障碍物是否为虚拟爬梯。当检测结果显示障碍物为虚拟爬梯时,表示目标角色只能沿着虚拟爬梯进行攀爬,虚拟爬梯营造的环境不具有提供自由攀爬的条件,因此,控制目标角色沿着虚拟爬梯的铺设轨迹进行攀爬。而当检测结果显示障碍物并非虚拟爬梯时,表明该障碍物并不是虚拟爬梯,确定是诸如山、高楼等实体,这种实体可以提供一定范围的攀爬区域,在这一定范围的攀爬区域内,目标角色是可以自由攀爬的,因此,通过整个过程可以确定识别到障碍物不仅允许交互,而且障碍物的地形也满足攀爬条件,可以继续执行下述步骤203中的过程。And if it is recognized that the obstacle is not allowed to be pushed and not allowed to be climbed, it is necessary to continue to determine whether the obstacle can be climbed. The determination of whether the obstacle can be climbed is achieved by querying whether the obstacle carries a climbing prohibition mark. When querying whether an obstacle carries a climbing prohibition mark, if the obstacle does not carry a climbing prohibition mark, it means that the obstacle can be climbed. In the game world, the obstacles that can be climbed are generally divided into categories. There are two types, one is entities such as mountains, tall buildings, etc., which can provide players with free climbing functions, and the other is virtual ladders, which are also ladders. Generally speaking, ladders The size of is fixed, so that the climbing range that the ladder can provide is also fixed. The target character can only climb along the ladder. Therefore, after confirming that the obstacle can be climbed, the center point of the target character needs to be taken as the starting point , Transmit a detection ray of a preset length in the horizontal direction, and receive a detection result returned by the detection ray, and determine whether the obstacle is a virtual climbing ladder according to the detection result. When the detection result shows that the obstacle is a virtual ladder, it means that the target character can only climb along the virtual ladder. The environment created by the virtual ladder does not provide the conditions for free climbing. Therefore, the target character is controlled to follow the virtual ladder's laying trajectory Climb. When the detection result shows that the obstacle is not a virtual climbing ladder, it indicates that the obstacle is not a virtual climbing ladder. It is determined that it is an entity such as a mountain or a tall building. This entity can provide a certain range of climbing area, in this certain range of climbing area Inside, the target character can climb freely. Therefore, through the whole process, it can be determined that the obstacle is not only allowed to interact, but the terrain of the obstacle also satisfies the climbing conditions, and the process in step 203 below can be continued.
在实际应用的过程中,整个对障碍物的地形进行识别的过程总结如下:In the actual application process, the entire process of identifying the terrain of obstacles is summarized as follows:
参见图2B,首先确定该障碍物是否可以进行交互,如果该障碍物不可以交互,则结束当前流程。如果该障碍物可以交互,则继续判断该障碍物是否可以推动。如果该障碍物是可以推动的,则直接控制目标角色进入推动状态,对该障碍物进行推动,并结束当前流程。如果该障碍物不可以推动,则继续判断该障碍物是否可以翻越。如果该障碍物是可以翻越的,则直接控制 目标角色进入翻越状态,翻越该障碍物,并结束当前流程。如果该障碍物不可以翻越,则查询该障碍物是否携带禁止攀爬标记。如果该障碍物携带了禁止攀爬标记,则表示该障碍物在游戏世界中是不允许攀爬的,直接结束当前流程,不提供攀爬功能即可。如果该障碍物未携带禁止攀爬标记,则表示该障碍物可以进行攀爬,需要进一步确定该障碍物是否为虚拟爬梯。当确定该障碍物为虚拟爬梯时,直接控制目标角色沿着虚拟爬梯进行攀爬即可。当确定该障碍物不是虚拟爬梯时,便确定该障碍物可以提供自由攀爬的功能,继续执行对障碍物的其他识别并按照玩家的操作控制目标角色在障碍物上进行攀爬。Referring to Fig. 2B, it is first determined whether the obstacle can be interacted, and if the obstacle cannot be interacted, the current process is ended. If the obstacle can be interacted, continue to judge whether the obstacle can be pushed. If the obstacle can be pushed, the target character is directly controlled to enter the pushing state, the obstacle is pushed, and the current process is ended. If the obstacle cannot be pushed, continue to judge whether the obstacle can be overturned. If the obstacle can be surmounted, then directly control the target character to enter the surpassing state, surpass the obstacle, and end the current process. If the obstacle cannot be overturned, check whether the obstacle carries a climbing prohibition mark. If the obstacle carries a climbing prohibition mark, it means that the obstacle is not allowed to be climbed in the game world, and the current process is ended directly without providing the climbing function. If the obstacle does not carry a climbing prohibition mark, it means that the obstacle can be climbed, and it is necessary to further determine whether the obstacle is a virtual climbing ladder. When it is determined that the obstacle is a virtual ladder, the target character can be directly controlled to climb along the virtual ladder. When it is determined that the obstacle is not a virtual climbing ladder, it is determined that the obstacle can provide a free climbing function, continue to perform other recognition of the obstacle, and control the target character to climb on the obstacle according to the operation of the player.
203、在识别确定所述障碍物允许交互且地形满足攀爬条件下,基于目标角色向障碍物发射检测射线,确定组成障碍物的至少一个墙面。203. After identifying and determining that the obstacle allows interaction and the terrain satisfies the climbing condition, emit detection rays to the obstacle based on the target character, and determine at least one wall that composes the obstacle.
在本发明实施例中,考虑到游戏世界中的障碍物很多都是不规则形状的,而在不规则形状的障碍物上进行攀爬时,角色相对于障碍物的法向量都是不同的,只有确定了目标角色的位置与障碍物形成的法向量才能精准的确定目标角色的角色朝向,因此,当检测到障碍物的地形允许攀爬时,需要确定组成障碍物的至少一个墙面,进而确定目标角色的角色朝向。其中,在确定组成障碍物的至少一个墙面时,可以基于目标角色向障碍物发射检测射线,根据检测射线是否命中以及命中后检测射线返回的内容确定障碍物覆盖到哪些范围。In the embodiment of the present invention, considering that many obstacles in the game world are irregularly shaped, and when climbing on an irregularly shaped obstacle, the normal vector of the character relative to the obstacle is different, Only by determining the position of the target character and the normal vector formed by the obstacle can the character orientation of the target character be accurately determined. Therefore, when the terrain of the obstacle is detected to allow climbing, it is necessary to determine at least one wall composing the obstacle, and then Determine the character orientation of the target character. Wherein, when determining at least one wall composing an obstacle, a detection ray may be emitted to the obstacle based on the target character, and the range covered by the obstacle may be determined according to whether the detection ray hits and the content of the detection ray returned after the hit.
在确定组成障碍物的至少一个墙面时,首先,控制目标角色贴近障碍物。其中,在控制目标角色贴近障碍物时,由于玩家如果希望目标角色在障碍物上进行攀爬时,会通过摇杆对目标角色进行控制,使得目标角色会携带速度向量,因此,可以先确定该目标角色携带的速度向量,确定速度向量指示的目标角色的前进方向,进而以目标角色的当前位置为起点,控制目标角色向前进方向进行碰撞,将目标角色与障碍物发生碰撞的位置确定为墙面位置,并将目标角色调整至墙面位置指示的位置,以使得目标角色紧贴障碍物。在实际应用的过程中,上述将目标角色紧贴障碍物的过程可以基于函数MoveAlongVines(沿途行进)实现,在该函数中,可将目标角色视为一个玩家胶囊体,以玩家胶囊体为形状,玩家胶囊体的位置为起点,按照速度向量 的指示向前方做一次碰撞检测,检测障碍物的墙面位置,以便使玩家胶囊体可以紧贴障碍物进行运动。When determining at least one wall that composes an obstacle, first, control the target character to approach the obstacle. Among them, when the target character is controlled to be close to the obstacle, since the player wants the target character to climb on the obstacle, the target character will be controlled by the joystick so that the target character will carry the speed vector. Therefore, the player can first determine the speed vector. The speed vector carried by the target character determines the forward direction of the target character indicated by the speed vector, and then uses the current position of the target character as the starting point to control the target character to collide in the forward direction, and determine the position where the target character collides with the obstacle as the wall Face position, and adjust the target character to the position indicated by the wall position so that the target character is close to the obstacle. In the actual application process, the above process of putting the target character close to the obstacle can be realized based on the function MoveAlongVines (walking along the way), in which the target character can be regarded as a player capsule, and the player capsule is the shape. The position of the player's capsule is the starting point, and a collision detection is performed forward according to the instructions of the speed vector to detect the position of the wall of the obstacle, so that the player's capsule can move close to the obstacle.
随后,完成了目标角色紧贴障碍物后,基于速度向量,确定目标角色的分速度以及分速度指示的分速度方向。其中,游戏世界是3D(Three Dimensions,三维)世界,目标角色的速度向量是一个三维变量,也即虚拟引擎中的FVector(其他类矢量),该速度向量是可以分解前后、左右和上下三个方向上的分量的。而由于攀爬时目标角色需要紧贴障碍物,前后方向上的速度分量用于碰撞测试中,因此,在确定角色朝向时,需要应用左右方向上的速度,也就是目标角色在速度向量指示的前进方向的左向速度或右向速度,也即本发明实施例中的分速度,以使后续通过对分速度进行处理计算就可以确定目标角色的角色朝向。在确定分速度时,将速度向量投影在目标角色的前进方向右侧的水平线上,得到分速度,并将速度向量与分速度相乘,得到速度乘积。这样,当速度乘积的取值为正数时,确定目标角色是存在右向的速度的,可将分速度方向设置为前进方向的右向。当速度乘积的取值为负数时,确定目标角色不存在右向的速度,而存在左向的速度,因此,将分速度方向设置为前进方向的右向。Subsequently, after the target character is close to the obstacle, based on the speed vector, the target character's sub-velocity and the sub-velocity direction indicated by the sub-velocity are determined. Among them, the game world is a 3D (Three Dimensions) world. The speed vector of the target character is a three-dimensional variable, that is, the FVector (other vector) in the virtual engine. The speed vector can be decomposed into three The component of the direction. Since the target character needs to be close to the obstacle when climbing, the speed component in the front and rear direction is used in the collision test. Therefore, when determining the character's orientation, the speed in the left and right directions needs to be applied, that is, the target character is indicated by the speed vector. The leftward speed or the rightward speed in the forward direction, that is, the partial speed in the embodiment of the present invention, so that subsequent processing and calculation of the partial speed can determine the character orientation of the target character. When determining the partial speed, project the speed vector on the horizontal line on the right side of the target character's forward direction to obtain the partial speed, and multiply the speed vector by the partial speed to obtain the speed product. In this way, when the value of the speed product is a positive number, it is determined that the target character has a rightward speed, and the sub-speed direction can be set to the right direction of the forward direction. When the value of the speed product is a negative number, it is determined that the target character does not have a rightward speed, but has a leftward speed. Therefore, the sub-speed direction is set to the right direction of the forward direction.
最后,确定了分速度后,便向分速度方向发射检测射线。若检测射线命中障碍物,则可直接将命中的实体作为至少一个墙面。若检测射线未命中目标墙面,则需要分别向前进方向、前进方向的左侧以及前进方向的右侧发射检测射线,并将检测射线命中的实体作为至少一个墙面。其中,根据检测射线是否命中障碍物来确定至少一个墙面分为多种可能,因此,对多种可能分别进行描述,整个墙面的检测过程如下:Finally, after determining the sub-velocities, the detection rays are emitted in the direction of the sub-velocities. If the detection ray hits an obstacle, the hit entity can be directly used as at least one wall. If the detection ray misses the target wall, the detection ray needs to be emitted to the advancing direction, the left side of the advancing direction, and the right side of the advancing direction respectively, and the entity hit by the detection ray is used as at least one wall. Among them, it is determined that at least one wall is divided into multiple possibilities according to whether the detection ray hits the obstacle. Therefore, the multiple possibilities are described separately. The detection process of the entire wall is as follows:
参见图2C,确定分速度方向,如果存在分速度,则向分速度方向发射检测射线。当检测射线命中障碍物时,可直接将命中的实体作为至少一个墙面。另外,参见图2D,圆形代表目标角色,如果障碍物为图示的形状,则目标角色在图2D中所示的三个位置对障碍物进行墙面的检测是可以直接基于分速度方向进行的射线检测命中的,因此,进一步地,还可以确定障碍物的至少一个墙面的形状为图2D所示的形状,也即N型朝内墙面,且目标角色与至少一个墙面的相对位置可能为图2D中所示的任一种可能,这样,在 后续可以根据命中的检测射线返回的内容确定角色朝向,以便控制目标角色进行转向。当检测射线没有命中障碍物时,就需要对目标角色进行多方位的检测。首先,可以向目标角色的前进方向的左侧发射检测射线。如果该检测射线没有命中障碍物,则从目标角色的左前方开始持续向右侧发射检测射线,并在检测射线命中时可以直接确定命中的实体即为至少一个墙面。需要说明的是,在这个持续发射检测射线的过程中,左侧没有命中说明目标角色的左侧是没有遮挡的,但是在移动发射检测射线的过程中是存在遮挡的,由此可以推断障碍物的至少一个墙面可能是图2E所示的形状,也即U型朝外墙面,而目标角色与至少一个墙面的相对位置为第一种可能,这样,在后续可以根据命中的检测射线返回的内容确定角色朝向,以便控制目标角色进行转向。如果在向目标角色的前进方向的左侧发射检测射线命中了,则可将命中的实体作为组成障碍物的左侧墙面,记录该左侧墙面,并在随后向目标角色的前进方向的右侧发射检测射线,确定是否存在右侧墙面。另外,在从目标角色的左前方开始持续向右侧发射检测射线时,也是存在没有命中任何实体的可能的,所以,如果从目标角色的左前方开始持续向右侧发射检测射线时没有发生命中,则也向目标角色的前进方向的右侧发射检测射线,确定是否存在右侧墙面。在向目标角色的前进方向的右侧发射检测射线后,如果检测射线命中了实体,则可将命中的实体作为组成障碍物的右侧墙面,记录该右侧墙面,并继续向目标角色的中间方向发射检测射线。如果向目标角色的前进方向的右侧发射检测射线没有命中,则需要从目标角色的右前方开始持续向左侧发射检测射线,并在检测射线命中时可以直接确定命中的实体即为至少一个墙面。需要说明的是,在这个持续发射检测射线的过程中,右侧没有命中说明目标角色的右侧是没有遮挡的,但是在移动发射检测射线的过程中是存在遮挡的,由此可以推断障碍物的至少一个墙面可能是图2E所示的形状,也即U型朝外墙面,而目标角色与至少一个墙面的相对位置为第三种可能,这样,在后续可以根据命中的检测射线返回的内容确定角色朝向,以便控制目标角色进行转向。而如果在从目标角色的右前方开始持续向左侧发射检测射线时,没有发生命中,则需要清零右侧墙面,并开始向目标角色的中间往前方发射检测射线。另外,在上述向目标角色的前进方向的右侧发射 检测射线后发生了命中,并记录了右侧墙面后,也开始向目标角色的中间往前方发射检测射线。如果向目标角色的中间往前方发射检测射线没有发生命中,则清零中间的向量,并在后续根据上述过程中命中的检测射线返回的内容计算角色朝向。如果向目标角色的中间往前方发射检测射线发生命中,则可以确定目标角色与至少一个墙面的相对位置为图2E中所示的第二种可能,接收该命中的检测射线返回的内容,进而确定目标角色的角色朝向。Refer to Figure 2C to determine the direction of the sub-velocity, and if there is a sub-velocity, the detection ray is emitted in the direction of the sub-velocity. When the detection ray hits an obstacle, the hit entity can be directly used as at least one wall. In addition, referring to Figure 2D, the circle represents the target character. If the obstacle is in the shape shown in the figure, the target character can directly detect the wall of the obstacle at the three positions shown in Figure 2D based on the sub-velocity direction. Therefore, it can be further determined that the shape of at least one wall of the obstacle is the shape shown in FIG. The position may be any one of the possibilities shown in FIG. 2D. In this way, the character orientation can be determined according to the content returned by the hit detection ray, so as to control the target character to turn. When the detection ray does not hit the obstacle, it is necessary to perform multi-directional detection of the target character. First, the detection ray can be emitted to the left side of the target character's advancing direction. If the detection ray does not hit the obstacle, the detection ray is continuously emitted from the front left of the target character to the right, and when the detection ray hits, it can be directly determined that the hit entity is at least one wall. It should be noted that in the process of continuously emitting detection rays, the left side does not hit, indicating that the left side of the target character is not occluded, but there is occlusion during the process of moving and emitting detection rays, which can be inferred from obstacles. At least one of the walls may have the shape shown in Figure 2E, that is, the U-shaped wall facing outwards, and the relative position of the target character and at least one of the walls is the first possibility. In this way, the detection ray of the hit can be The returned content determines the direction of the character in order to control the target character to turn. If the detection ray hits on the left side of the target character’s forward direction, the hit entity can be used as the left wall of the obstacle, record the left wall, and then move towards the target character’s forward direction. The right side emits detection rays to determine whether there is a right side wall. In addition, when the detection ray is continuously emitted to the right from the front left of the target character, there is also a possibility that no entity will be hit. Therefore, if the detection ray is continuously emitted from the front left of the target character to the right, no life is emitted. , The detection ray is also emitted to the right side of the target character's forward direction to determine whether there is a right side wall. After launching the detection ray to the right side of the target character's forward direction, if the detection ray hits the entity, the hit entity can be used as the right wall of the obstacle, record the right wall, and continue to the target character The detection beam is emitted in the middle direction. If the detection ray emitted to the right side of the target character's forward direction fails to hit, the detection ray needs to be continuously emitted from the front right of the target character to the left, and when the detection ray hits, it can be directly determined that the hit entity is at least one wall noodle. It should be noted that in the process of continuously emitting detection rays, the right side is not hit, indicating that the right side of the target character is not blocked, but there is occlusion during the process of moving and emitting detection rays, which can be inferred from obstacles. At least one of the walls may be the shape shown in Figure 2E, that is, the U-shaped wall facing outwards, and the relative position of the target character and at least one of the walls is the third possibility. In this way, the detection ray of the hit can be followed The returned content determines the direction of the character in order to control the target character to turn. However, if the detection ray continues to be emitted from the front right of the target character to the left, but no life is being emitted, the right wall must be cleared, and the detection ray must start to be emitted toward the middle of the target character to the front. In addition, after the detection ray was emitted to the right side of the target character's advancement direction, a hit occurred, and the right wall was recorded, the detection ray was also emitted to the middle of the target character and forward. If the detection ray is emitted to the middle of the target character and does not come forward, the vector in the middle is cleared, and the character's orientation is calculated based on the content returned by the detection ray hit in the above process. If the detection ray is emitted to the middle of the target character and forward, it can be determined that the relative position of the target character and at least one wall is the second possibility shown in FIG. 2E, and the content returned by the hit detection ray is received. Then determine the character orientation of the target character.
通过上述过程,便可以确定组成障碍物的至少一个墙面,进而在后续可以通过至少一个墙面与目标角色的相对位置,确定目标角色与至少一个墙面之间的法向量,以便根据法向量精确的计算目标角色的角色朝向。需要说明的是,上述确定至少一个墙面的过程可以通过函数UpdateVinesInfo(更新路线信息)实现,通过该函数可以在游戏世界中的每一帧都控制目标角色直接向障碍物发射检测射线并直接根据检测射线对障碍物的命中,生成至少一个法向量。Through the above process, at least one wall that composes the obstacle can be determined, and then the normal vector between the target character and the at least one wall can be determined by the relative position of the at least one wall and the target character, so that according to the normal vector Accurately calculate the character orientation of the target character. It should be noted that the above process of determining at least one wall can be implemented by the function UpdateVinesInfo (update route information), through which the target character can be controlled to emit detection rays directly to the obstacles in every frame of the game world and directly based on Detect the hit of the ray on the obstacle, and generate at least one normal vector.
204、接收检测射线在命中至少一个墙面后返回的至少一个法向量,采用至少一个法向量计算目标角色的角色朝向。204. Receive at least one normal vector returned by the detection ray after hitting at least one wall, and use the at least one normal vector to calculate the character orientation of the target character.
在本发明实施例中,由于至少一个墙面组成的障碍物是可能有多种形状的,而且目标角色与至少一个墙面的相对位置是存在多种可能的,因此,需要确定目标角色当前紧贴障碍物所处的位置与至少一个墙面形成的法向量,进而根据法向量在计算目标角色的角色朝向。其中,由于在上述步骤204中目标角色向障碍物发生的检测射线都是水平发射的,当检测射线命中了至少一个墙面后,便可以直接确定目标角色与墙面形成的法向量。所以,可接收检测射线在命中至少一个墙面后返回的至少一个法向量,并采用至少一个法向量计算目标角色的角色朝向。需要说明的是,参见步骤203中发射检测射线的过程可知,会向目标角色的左侧、中间以及右侧分别发送检测射线,这样,命中障碍物时,就会返回至少一个不同方位的法向量,所以,至少一个法向量可以分为左侧法向量、中间法向量以及右侧法向量。其中,左侧法向量可用Left Vines Normal(左侧法向量)表示,中间法向量可用Middle Vines Normal(中间法向量)表示,右侧法向量可用Right Vines Normal(右侧法向量)表示。In the embodiment of the present invention, since the obstacle composed of at least one wall may have various shapes, and the relative position of the target character and the at least one wall may have many possibilities, therefore, it is necessary to determine the current tightness of the target character. The normal vector formed by the position where the obstacle is located and at least one wall surface is then used to calculate the character orientation of the target character based on the normal vector. Wherein, since the detection rays from the target character to the obstacle in step 204 are all emitted horizontally, when the detection rays hit at least one wall, the normal vector formed by the target character and the wall can be directly determined. Therefore, at least one normal vector returned by the detection ray after hitting at least one wall can be received, and the at least one normal vector can be used to calculate the character orientation of the target character. It should be noted that, referring to the process of emitting detection rays in step 203, it can be seen that the detection rays will be sent to the left, middle and right sides of the target character respectively. In this way, when an obstacle is hit, at least one normal vector in a different orientation will be returned. , So at least one normal vector can be divided into left normal vector, middle normal vector and right normal vector. Among them, the left normal vector can be represented by Left Vines Normal (left normal vector), the middle normal vector can be represented by Middle Vines Normal (middle normal vector), and the right normal vector can be represented by Right Vines Normal (right normal vector).
在采用至少一个法向量计算目标角色的角色朝向时,首先,需要计算至少一个法向量的第一向量和,将第一向量和标准化,得到标准向量和。随后,对标准向量和进行取反操作,将取反后的标准向量和指示的方向作为角色朝向。When using at least one normal vector to calculate the character orientation of the target character, first, it is necessary to calculate the first vector sum of at least one normal vector, and normalize the first vector sum to obtain the standard vector sum. Subsequently, the standard vector sum is inverted, and the inverted standard vector and the indicated direction are used as the character orientation.
205、获取目标角色携带的速度向量,控制目标角色按照角色朝向以及速度向量紧贴障碍物进行攀爬。205. Obtain the speed vector carried by the target character, and control the target character to climb closely to the obstacle according to the direction of the character and the speed vector.
在本发明实施例中,由于目标角色会携带玩家通过摇杆控制目标角色而传达的速度向量,因此,在确定了目标角色的角色朝向后,可以获取目标角色携带的速度向量,控制该目标角色按照角色朝向以及速度向量紧贴障碍物进行攀爬即可。In the embodiment of the present invention, since the target character carries the speed vector conveyed by the player through the joystick to control the target character, after the character orientation of the target character is determined, the speed vector carried by the target character can be obtained to control the target character Climb closely to the obstacle according to the character's orientation and speed vector.
需要说明的是,由于在实际游戏的过程中,目标角色相对于障碍物的位置是随着时间不断变化的,且每时每刻玩家对目标角色的控制中下发的速度向量也可能会随着玩家的意愿不断变化,因此,为了保证目标角色在游戏世界中的行为可以精确跟随玩家的操作,游戏中的每一帧都需要执行上述步骤201至步骤205中所示的过程,对障碍物进行检测以及确定目标角色的角色朝向,进而控制目标角色按照玩家的实时操作行动。It should be noted that in the actual game process, the position of the target character relative to the obstacle is constantly changing over time, and the speed vector issued by the player in the control of the target character may also vary from time to time. The player’s wishes are constantly changing. Therefore, in order to ensure that the target character’s behavior in the game world can accurately follow the player’s operation, the process shown in steps 201 to 205 above needs to be performed in each frame of the game. Perform detection and determine the character orientation of the target character, and then control the target character to act in accordance with the player's real-time operation.
而在实际应用的过程中,玩家凭借自身的意愿在控制目标角色移动时,可能会希望目标角色转向,这样,当检测到玩家控制目标角色进行转向时,可以获取玩家向目标角色输入的待转向速度向量,并计算待转向速度向量与速度向量的向量差值,将向量差值指示的方向作为待转向方向,进而控制目标角色向角色朝向往待转向方向进行过渡,以便达到目标角色顺滑转向的效果。In the actual application process, when the player controls the target character to move according to his own will, he may want the target character to turn. In this way, when it is detected that the player controls the target character to turn, the player's input to the target character to be turned can be obtained. Speed vector, and calculate the vector difference between the speed vector to be turned and the speed vector, and use the direction indicated by the vector difference as the direction to be turned, and then control the target character to transition from the direction of the character to the direction to be turned, so as to achieve the smooth steering of the target character Effect.
需要说明的是,游戏中目标角色对障碍物的攀爬分为两种情况,一种是向下攀爬,一种是向上攀爬。如果目标角色向下攀爬,则当确定目标角色爬到可以行走的地面时,控制目标角色退出攀爬状态即可。如果目标角色向上攀爬,则当确定目标角色爬到障碍物的顶端时,控制目标角色翻越障碍物的顶端并退出攀爬状态即可。It should be noted that there are two situations in which the target character climbs obstacles in the game, one is climbing downwards and the other is climbing upwards. If the target character climbs downwards, when it is determined that the target character climbs to a walkable ground, control the target character to exit the climbing state. If the target character climbs upwards, when it is determined that the target character climbs to the top of the obstacle, control the target character to climb over the top of the obstacle and exit the climbing state.
再有,上述过程中描述的是目标角色在行走至障碍物处,与障碍物发生碰撞后触发的攀爬过程,而在游戏世界中,还会提供攀爬跳跃的功能,也即 玩家通过摇杆控制目标角色进行攀爬跳跃,使得目标角色跳跃一定高度,挂载在障碍物的一定高度,进而在从一定高度向上或者向下攀爬。或者,玩家在游戏的过程中还可能控制目标角色进行攀爬回跳,也即向目前目标角色的角色朝向的反方向进行跳跃。进一步地,考虑到游戏世界中的实际环境,很可能玩家进行攀爬所处的环境是室外雨天,为了使游戏世界与真实世界更加相符,还可在游戏的室外雨天环境中设置一种角色的下滑机制,模拟目标角色一边向上攀爬,一边由于湿滑的障碍物向下下滑的情况。需要说明的是,不论是本发明中描述的攀爬过程,还是上述提及的退出攀爬状态、攀爬跳跃、攀爬回跳、攀爬翻越以及雨天攀爬,都可以配合游戏中的动画特效实现,使得目标角色的整个攀爬过程更加的逼真,增强用户的游戏体验。Furthermore, the above process describes the climbing process triggered by the target character walking to the obstacle and colliding with the obstacle. In the game world, the function of climbing and jumping is also provided, that is, the player can use the shaking The rod controls the target character to climb and jump, so that the target character jumps to a certain height, is mounted on a certain height of an obstacle, and then climbs up or down from a certain height. Alternatively, the player may also control the target character to climb and jump back during the game, that is, to jump in the opposite direction of the current target character's character. Further, considering the actual environment in the game world, it is likely that the environment where the player is climbing is an outdoor rainy day. In order to make the game world more consistent with the real world, you can also set a role in the outdoor rainy environment of the game. The sliding mechanism simulates the situation where the target character climbs upwards while sliding downwards due to slippery obstacles. It should be noted that, whether it is the climbing process described in the present invention, or the above-mentioned exit climbing state, climbing jump, climbing back jump, climbing over jump, and rainy climbing, they can all cooperate with the animation in the game. The realization of special effects makes the entire climbing process of the target character more realistic and enhances the user's gaming experience.
本发明实施例提供的方法,可以确定与目标角色发生碰撞的障碍物,在识别确定障碍物允许交互且地形满足攀爬条件下,基于目标角色向障碍物发射检测射线,确定组成障碍物的至少一个墙面,并接收检测射线在命中至少一个墙面后返回的至少一个法向量,采用至少一个法向量计算目标角色的角色朝向,进而获取目标角色携带的速度向量,控制目标角色按照角色朝向以及速度向量紧贴障碍物进行攀爬,使得障碍物上无需设置任何固定的攀爬路线,通过目标角色与障碍物之间持续进行射线检测来确定目标角色想要行进的方向,从而控制目标角色自动在障碍物上进行攀爬,角色的攀爬范围不会受到限制,保证游戏的真实性,赋予游戏角色生命力,提高了游戏的智能性,增强玩家的游戏体验。The method provided by the embodiment of the present invention can determine the obstacle that collides with the target character. After the obstacle is identified and determined to allow interaction and the terrain satisfies the climbing condition, the target character emits detection rays to the obstacle to determine at least the component of the obstacle. A wall, and receive at least one normal vector returned by the detection ray after hitting at least one wall, use at least one normal vector to calculate the character orientation of the target character, and then obtain the speed vector carried by the target character, and control the target character according to the character orientation and The speed vector is close to the obstacle for climbing, so that there is no need to set any fixed climbing route on the obstacle. The continuous ray detection between the target character and the obstacle is used to determine the direction the target character wants to travel, thereby controlling the target character automatically Climbing on obstacles, the climbing range of the character will not be restricted, ensuring the authenticity of the game, giving the game character vitality, improving the intelligence of the game, and enhancing the game experience of the player.
进一步地,作为图1所述方法的具体实现,本发明实施例提供了一种角色攀爬装置,如图3A所示,所述装置包括:确定模块301,发射模块302,第一计算模块303和控制模块304。Further, as a specific implementation of the method described in FIG. 1, an embodiment of the present invention provides a character climbing device. As shown in FIG. 3A, the device includes: a determination module 301, a transmission module 302, and a first calculation module 303 And control module 304.
该确定模块301,用于确定与目标角色发生碰撞的障碍物;The determining module 301 is used to determine obstacles that collide with the target character;
该发射模块302,用于在识别确定所述障碍物允许交互且地形满足攀爬条件下,基于所述目标角色向所述障碍物发射检测射线,确定组成所述障碍物的至少一个墙面;The transmitting module 302 is configured to transmit detection rays to the obstacle based on the target character when it is determined that the obstacle allows interaction and the terrain satisfies climbing conditions to determine at least one wall composing the obstacle;
该第一计算模块303,用于接收所述检测射线在命中所述至少一个墙面后返回的至少一个法向量,采用所述至少一个法向量计算所述目标角色的角 色朝向;The first calculation module 303 is configured to receive at least one normal vector returned by the detection ray after hitting the at least one wall, and use the at least one normal vector to calculate the character orientation of the target character;
该控制模块304,用于获取所述目标角色携带的速度向量,控制所述目标角色按照所述角色朝向以及所述速度向量紧贴所述障碍物进行攀爬。The control module 304 is configured to obtain a speed vector carried by the target character, and control the target character to climb closely against the obstacle according to the character's orientation and the speed vector.
在具体的应用场景中,如图3B所示,该装置还包括:第一获取模块305,第一检测模块306和查询模块307。In a specific application scenario, as shown in FIG. 3B, the device further includes: a first acquisition module 305, a first detection module 306, and a query module 307.
该第一获取模块305,用于获取所述障碍物的实体属性;The first obtaining module 305 is configured to obtain the physical attributes of the obstacle;
该第一检测模块306,用于当所述障碍物的实体属性指示所述障碍物允许交互时,检测所述障碍物是否允许推动以及是否允许翻越;The first detection module 306 is configured to detect whether the obstacle is allowed to be pushed and whether it is allowed to be overturned when the physical attribute of the obstacle indicates that the obstacle is allowed to interact;
该查询模块307,用于若检测到所述障碍物不允许推动且不允许翻越,则查询所述障碍物是否携带禁止攀爬标记;The query module 307 is configured to query whether the obstacle carries a climbing prohibition mark if it is detected that the obstacle is not allowed to be pushed and not allowed to be overturned;
该发射模块302,还用于若查询到所述障碍物未携带所述禁止攀爬标记,则以所述目标角色的中心点为起点,向水平方向发射预设长度的检测射线,并接收所述检测射线返回的检测结果;The transmitting module 302 is also configured to, if the obstacle does not carry the climbing prohibition mark, use the center point of the target character as the starting point, transmit a detection ray of a preset length in the horizontal direction, and receive the The detection result returned by the detection ray;
该控制模块304,还用于当所述检测结果显示所述障碍物为虚拟爬梯时,控制所述目标角色沿着所述虚拟爬梯的铺设轨迹进行攀爬;The control module 304 is further configured to control the target character to climb along the laying trajectory of the virtual ladder when the detection result shows that the obstacle is a virtual ladder;
该发射模块302,还用于当所述检测结果显示所述障碍物并非所述虚拟爬梯时,识别确定所述障碍物允许交互且所述地形满足所述攀爬条件。The transmitting module 302 is also used for identifying and determining that the obstacle allows interaction and the terrain satisfies the climbing condition when the detection result shows that the obstacle is not the virtual climbing ladder.
在具体的应用场景中,如图3C所示,该装置还包括:推动模块308和翻越模块309。In a specific application scenario, as shown in FIG. 3C, the device further includes: a pushing module 308 and a flipping module 309.
该推动模块308,用于当检测到所述障碍物允许推动时,将所述目标角色调整至推动状态,控制所述目标角色推动所述障碍物,并省略检测所述障碍物是否允许翻越的过程;The pushing module 308 is used to adjust the target character to a pushing state when it is detected that the obstacle is allowed to be pushed, control the target character to push the obstacle, and omit the detection of whether the obstacle is allowed to be overturned process;
该翻越模块309,用于当检测到所述障碍物不允许推动时,检测所述障碍物是否允许翻越,并在确定所述障碍物允许翻越时,将所述目标角色调整至翻越状态,控制所述目标角色翻越所述障碍物。The overturning module 309 is used to detect whether the obstacle is allowed to be overturned when it is detected that the obstacle is not allowed to be pushed over, and when it is determined that the obstacle is allowed to be overturned, adjust the target character to the overturning state, and control The target character climbs over the obstacle.
在具体的应用场景中,如图3D所示,该发射模块302,包括:控制单元3021,第一确定单元3022,发射单元3023和第二确定单元3024。In a specific application scenario, as shown in FIG. 3D, the transmitting module 302 includes: a control unit 3021, a first determining unit 3022, a transmitting unit 3023, and a second determining unit 3024.
该控制单元3021,用于控制所述目标角色贴近所述障碍物;The control unit 3021 is used to control the target character to approach the obstacle;
该第一确定单元3022,用于基于所述速度向量,确定所述目标角色的分 速度以及所述分速度指示的分速度方向,所述分速度是所述目标角色在所述速度向量指示的前进方向的左向速度或右向速度;The first determining unit 3022 is configured to determine, based on the velocity vector, the sub-velocity of the target character and the sub-velocity direction indicated by the sub-velocity, where the sub-velocity is indicated by the target character in the velocity vector Left or right speed in the forward direction;
该发射单元3023,用于向所述分速度方向发射检测射线;The emitting unit 3023 is used to emit detection rays in the sub-velocity direction;
该第二确定单元3024,用于若所述检测射线命中所述障碍物,则将命中的实体作为所述至少一个墙面;The second determining unit 3024 is configured to use the hit entity as the at least one wall surface if the detection ray hits the obstacle;
该第二确定单元3024,还用于若所述检测射线未命中所述目标墙面,则分别向所述前进方向、所述前进方向的左侧以及所述前进方向的右侧发射所述检测射线,并将所述检测射线命中的实体作为所述至少一个墙面。The second determining unit 3024 is further configured to transmit the detection to the forward direction, the left side of the forward direction, and the right side of the forward direction if the detection ray misses the target wall surface. Ray, and the entity hit by the detection ray is used as the at least one wall surface.
在具体的应用场景中,该控制单元3021,用于确定所述速度向量指示的所述目标角色的前进方向;以所述目标角色的当前位置为起点,控制所述目标角色向所述前进方向进行碰撞,将所述目标角色与所述障碍物发生碰撞的位置确定为墙面位置;将所述目标角色调整至所述墙面位置指示的位置,紧贴所述障碍物。In a specific application scenario, the control unit 3021 is used to determine the forward direction of the target character indicated by the speed vector; taking the current position of the target character as a starting point, control the target character to move in the forward direction A collision is performed, and the position where the target character collides with the obstacle is determined as the wall position; the target character is adjusted to the position indicated by the wall position, and is close to the obstacle.
在具体的应用场景中,该第一确定单元3022,用于将所述速度向量投影在所述目标角色的前进方向右侧的水平线上,得到所述分速度;将所述速度向量与所述分速度相乘,得到速度乘积;当所述速度乘积的取值为正数时,将所述分速度方向设置为所述前进方向的右向;当所述速度乘积的取值为负数时,将所述分速度方向设置为所述前进方向的右向。In a specific application scenario, the first determining unit 3022 is configured to project the velocity vector on the horizontal line on the right side of the target character's forward direction to obtain the sub-velocity; compare the velocity vector with the Multiply the partial speeds to obtain the speed product; when the value of the speed product is a positive number, the direction of the partial speed is set to the right of the forward direction; when the value of the speed product is a negative number, The sub-speed direction is set to the right of the forward direction.
在具体的应用场景中,该第一计算模块303,用于计算所述至少一个法向量的第一向量和,将所述第一向量和标准化,得到标准向量和;对所述标准向量和进行取反操作,将取反后的所述标准向量和指示的方向作为所述角色朝向。In a specific application scenario, the first calculation module 303 is used to calculate the first vector sum of the at least one normal vector, normalize the first vector sum to obtain the standard vector sum; perform the standard vector sum In the inversion operation, the inverted standard vector and the indicated direction are used as the character orientation.
在具体的应用场景中,如图3E所示,该装置还包括:第二获取模块310和第二计算模块311。In a specific application scenario, as shown in FIG. 3E, the device further includes: a second acquisition module 310 and a second calculation module 311.
该第二获取模块310,用于当检测到玩家控制所述目标角色进行转向时,获取所述玩家向所述目标角色输入的待转向速度向量;The second acquiring module 310 is configured to acquire the to-be-turned speed vector input by the player to the target character when it is detected that the player controls the target character to turn;
该第二计算模块311,用于计算所述待转向速度向量与所述速度向量的向量差值,将所述向量差值指示的方向作为待转向方向;The second calculation module 311 is configured to calculate the vector difference between the speed vector to be steered and the speed vector, and use the direction indicated by the vector difference as the direction to be steered;
该控制模块304,还用于控制所述目标角色向角色朝向往所述待转向方 向进行过渡。The control module 304 is also used to control the transition from the target character to the direction to be turned.
本发明实施例提供的装置,可以确定与目标角色发生碰撞的障碍物,在识别确定障碍物允许交互且地形满足攀爬条件下,基于目标角色向障碍物发射检测射线,确定组成障碍物的至少一个墙面,并接收检测射线在命中至少一个墙面后返回的至少一个法向量,采用至少一个法向量计算目标角色的角色朝向,进而获取目标角色携带的速度向量,控制目标角色按照角色朝向以及速度向量紧贴障碍物进行攀爬,使得障碍物上无需设置任何固定的攀爬路线,通过目标角色与障碍物之间持续进行射线检测来确定目标角色想要行进的方向,从而控制目标角色自动在障碍物上进行攀爬,角色的攀爬范围不会受到限制,保证游戏的真实性,赋予游戏角色生命力,提高了游戏的智能性,增强玩家的游戏体验。The device provided by the embodiment of the present invention can determine the obstacle that collides with the target character, and when the obstacle is identified and determined to allow interaction and the terrain satisfies the climbing conditions, the target character emits detection rays to the obstacle to determine at least the component of the obstacle A wall, and receive at least one normal vector returned by the detection ray after hitting at least one wall, use at least one normal vector to calculate the character orientation of the target character, and then obtain the speed vector carried by the target character, and control the target character according to the character orientation and The speed vector is close to the obstacle for climbing, so that there is no need to set any fixed climbing route on the obstacle. The continuous ray detection between the target character and the obstacle is used to determine the direction the target character wants to travel, thereby controlling the target character automatically Climbing on obstacles, the climbing range of the character will not be restricted, ensuring the authenticity of the game, giving the game character vitality, improving the intelligence of the game, and enhancing the game experience of the player.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的角色攀爬设备中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented by hardware, or by software modules running on one or more processors, or by a combination of them. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all components of the character climbing device according to the embodiment of the present invention. The present invention can also be implemented as a device or device program (for example, a computer program and a computer program product) for executing part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
例如,图4示出了可以实现根据本发明的角色攀爬的服务器,例如应用服务器。该服务器传统上包括处理器410和以存储器420形式的计算机程序产品或者计算机可读介质。存储器420可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器420具有用于执行上述方法中的任何方法步骤的程序代码431的存储空间430。例如,用于程序代码的存储空间430可以包括分别用于实现上面的方法中的各种步骤的各个程序代码431。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图5所述的便携式或者固定存储单元。 该存储单元可以具有与图4的服务器中的存储器420类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括计算机可读代码431’,即可以由例如诸如410之类的处理器读取的代码,这些代码当由服务器运行时,导致该服务器执行上面所描述的方法中的各个步骤。For example, FIG. 4 shows a server, such as an application server, that can implement the role climbing according to the present invention. The server traditionally includes a processor 410 and a computer program product in the form of a memory 420 or a computer-readable medium. The memory 420 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM. The memory 420 has a storage space 430 for executing the program code 431 of any method step in the foregoing method. For example, the storage space 430 for program codes may include various program codes 431 respectively used to implement various steps in the above method. These program codes can be read from or written into one or more computer program products. These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks. Such a computer program product is usually a portable or fixed storage unit as described with reference to FIG. 5. The storage unit may have storage segments, storage space, etc. arranged similarly to the storage 420 in the server of FIG. 4. The program code can be compressed in a suitable form, for example. Generally, the storage unit includes computer-readable codes 431', that is, codes that can be read by, for example, a processor such as 410, which, when run by a server, causes the server to perform the steps in the method described above.
本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味着,结合实施例描述的特定特征、结构或者特性包括在本发明的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。The “one embodiment”, “an embodiment” or “one or more embodiments” referred to herein means that a specific feature, structure or characteristic described in conjunction with the embodiment is included in at least one embodiment of the present invention. In addition, please note that the word examples "in one embodiment" here do not necessarily all refer to the same embodiment.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下被实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the instructions provided here, a lot of specific details are explained. However, it can be understood that the embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures, and technologies are not shown in detail, so as not to obscure the understanding of this specification.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the present invention, and those skilled in the art can design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be constructed as a limitation to the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of multiple such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims that list several devices, several of these devices may be embodied in the same hardware item. The use of the words first, second, and third, etc. do not indicate any order. These words can be interpreted as names.
此外,还应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的,而非限制性的,本发明的范围由所附权利要求书限定。In addition, it should also be noted that the language used in this specification is mainly selected for readability and teaching purposes, not for explaining or limiting the subject of the present invention. Therefore, without departing from the scope and spirit of the appended claims, many modifications and changes are obvious to those of ordinary skill in the art. For the scope of the present invention, the disclosure of the present invention is illustrative rather than restrictive, and the scope of the present invention is defined by the appended claims.

Claims (12)

  1. 一种角色攀爬方法,包括:A method of character climbing, including:
    确定与目标角色发生碰撞的障碍物;Determine the obstacles that collide with the target character;
    在识别确定所述障碍物允许交互且地形满足攀爬条件下,基于所述目标角色向所述障碍物发射检测射线,确定组成所述障碍物的至少一个墙面;When it is determined that the obstacle allows interaction and the terrain satisfies climbing conditions, transmitting detection rays to the obstacle based on the target character to determine at least one wall that composes the obstacle;
    接收所述检测射线在命中所述至少一个墙面后返回的至少一个法向量,采用所述至少一个法向量计算所述目标角色的角色朝向;Receiving at least one normal vector returned by the detection ray after hitting the at least one wall, and calculating the character orientation of the target character by using the at least one normal vector;
    获取所述目标角色携带的速度向量,控制所述目标角色按照所述角色朝向以及所述速度向量紧贴所述障碍物进行攀爬。The speed vector carried by the target character is obtained, and the target character is controlled to climb closely to the obstacle according to the direction of the character and the speed vector.
  2. 根据权利要求1所述的方法,其中,所述确定与目标角色发生碰撞的障碍物之后,所述方法还包括:The method according to claim 1, wherein after the determining the obstacle that collides with the target character, the method further comprises:
    获取所述障碍物的实体属性;Acquiring the physical attributes of the obstacle;
    当所述障碍物的实体属性指示所述障碍物允许交互时,检测所述障碍物是否允许推动以及是否允许翻越;When the physical attributes of the obstacle indicate that the obstacle allows interaction, detecting whether the obstacle is allowed to be pushed and whether it is allowed to be overturned;
    若检测到所述障碍物不允许推动且不允许翻越,则查询所述障碍物是否携带禁止攀爬标记;If it is detected that the obstacle is not allowed to be pushed and not allowed to be overturned, then query whether the obstacle carries a climbing prohibition mark;
    若查询到所述障碍物未携带所述禁止攀爬标记,则以所述目标角色的中心点为起点,向水平方向发射预设长度的检测射线,并接收所述检测射线返回的检测结果;If it is found that the obstacle does not carry the climbing prohibition mark, the center point of the target character is used as a starting point, a detection ray of a preset length is emitted in a horizontal direction, and the detection result returned by the detection ray is received;
    当所述检测结果显示所述障碍物为虚拟爬梯时,控制所述目标角色沿着所述虚拟爬梯的铺设轨迹进行攀爬;When the detection result shows that the obstacle is a virtual ladder, controlling the target character to climb along the laying track of the virtual ladder;
    当所述检测结果显示所述障碍物并非所述虚拟爬梯时,识别确定所述障碍物允许交互且所述地形满足所述攀爬条件。When the detection result shows that the obstacle is not the virtual climbing ladder, identifying and determining that the obstacle allows interaction and the terrain satisfies the climbing condition.
  3. 根据权利要求2所述的方法,其中,所述检测所述障碍物是否允许推动以及是否允许翻越之后,所述方法还包括:The method according to claim 2, wherein, after said detecting whether the obstacle is allowed to be pushed and whether to be allowed to be overturned, the method further comprises:
    当检测到所述障碍物允许推动时,将所述目标角色调整至推动状态,控制所述目标角色推动所述障碍物,并省略检测所述障碍物是否允许翻越的过程;When it is detected that the obstacle is allowed to be pushed, the target character is adjusted to a push state, the target character is controlled to push the obstacle, and the process of detecting whether the obstacle is allowed to be overturned is omitted;
    当检测到所述障碍物不允许推动时,检测所述障碍物是否允许翻越,并 在确定所述障碍物允许翻越时,将所述目标角色调整至翻越状态,控制所述目标角色翻越所述障碍物。When it is detected that the obstacle is not allowed to be pushed, it is detected whether the obstacle is allowed to be overturned, and when it is determined that the obstacle is allowed to be overturned, the target character is adjusted to the overturning state, and the target character is controlled to overturn the obstacle.
  4. 根据权利要求1所述的方法,其中,所述基于所述目标角色向所述障碍物发射检测射线,确定组成所述障碍物的至少一个墙面,包括:The method according to claim 1, wherein the transmitting detection rays to the obstacle based on the target role to determine at least one wall composing the obstacle comprises:
    控制所述目标角色贴近所述障碍物;Controlling the target character to approach the obstacle;
    基于所述速度向量,确定所述目标角色的分速度以及所述分速度指示的分速度方向,所述分速度是所述目标角色在所述速度向量指示的前进方向的左向速度或右向速度;Based on the speed vector, determine the sub-velocity of the target character and the sub-velocity direction indicated by the sub-velocity, where the sub-velocity is the left or right speed of the target character in the forward direction indicated by the speed vector speed;
    向所述分速度方向发射检测射线;Emit detection rays to the sub-velocity direction;
    若所述检测射线命中所述障碍物,则将命中的实体作为所述至少一个墙面;If the detection ray hits the obstacle, use the hit entity as the at least one wall surface;
    若所述检测射线未命中所述目标墙面,则分别向所述前进方向、所述前进方向的左侧以及所述前进方向的右侧发射所述检测射线,并将所述检测射线命中的实体作为所述至少一个墙面。If the detection ray does not hit the target wall, the detection ray is emitted to the forward direction, the left side of the forward direction, and the right side of the forward direction respectively, and the detection ray hits the target wall. The entity serves as the at least one wall surface.
  5. 根据权利要求4所述的方法,其中,所述控制所述目标角色贴近所述障碍物,包括:The method according to claim 4, wherein said controlling said target character to be close to said obstacle comprises:
    确定所述速度向量指示的所述目标角色的前进方向;Determining the forward direction of the target character indicated by the speed vector;
    以所述目标角色的当前位置为起点,控制所述目标角色向所述前进方向进行碰撞,将所述目标角色与所述障碍物发生碰撞的位置确定为墙面位置;Taking the current position of the target character as a starting point, controlling the target character to collide in the forward direction, and determining a position where the target character collides with the obstacle as a wall position;
    将所述目标角色调整至所述墙面位置指示的位置,紧贴所述障碍物。The target character is adjusted to the position indicated by the wall position and close to the obstacle.
  6. 根据权利要求4所述的方法,其中,所述基于所述速度向量,确定所述目标角色的分速度以及所述分速度指示的分速度方向,包括:The method according to claim 4, wherein the determining the partial speed of the target character and the direction of the partial speed indicated by the partial speed based on the speed vector comprises:
    将所述速度向量投影在所述目标角色的前进方向右侧的水平线上,得到所述分速度;Project the velocity vector on the horizontal line on the right side of the target character's forward direction to obtain the sub-velocity;
    将所述速度向量与所述分速度相乘,得到速度乘积;Multiply the velocity vector by the sub-velocity to obtain a velocity product;
    当所述速度乘积的取值为正数时,将所述分速度方向设置为所述前进方向的右向;When the value of the speed product is a positive number, the sub-speed direction is set to the right of the forward direction;
    当所述速度乘积的取值为负数时,将所述分速度方向设置为所述前进方向的右向。When the value of the velocity product is a negative number, the sub-velocity direction is set to the right of the forward direction.
  7. 根据权利要求1所述的方法,其中,所述采用所述至少一个法向量计算所述目标角色的角色朝向,包括:The method according to claim 1, wherein the calculating the character orientation of the target character by using the at least one normal vector comprises:
    计算所述至少一个法向量的第一向量和,将所述第一向量和标准化,得到标准向量和;Calculating a first vector sum of the at least one normal vector, and standardizing the first vector sum to obtain a standard vector sum;
    对所述标准向量和进行取反操作,将取反后的所述标准向量和指示的方向作为所述角色朝向。An inversion operation is performed on the standard vector sum, and the direction indicated by the standard vector sum after the inversion is used as the character orientation.
  8. 根据权利要求1所述的方法,其中,向以及所述速度向量紧贴所述障碍物进行攀爬之后,所述方法还包括:The method according to claim 1, wherein after climbing closely to the obstacle and the speed vector, the method further comprises:
    当检测到玩家控制所述目标角色进行转向时,获取所述玩家向所述目标角色输入的待转向速度向量;When it is detected that the player controls the target character to turn, acquiring the to-be-turned speed vector input by the player to the target character;
    计算所述待转向速度向量与所述速度向量的向量差值,将所述向量差值指示的方向作为待转向方向;Calculating a vector difference between the speed vector to be steered and the speed vector, and using the direction indicated by the vector difference as the direction to be steered;
    控制所述目标角色向角色朝向往所述待转向方向进行过渡。Control the target character to transition from the character direction to the direction to be turned.
  9. 一种角色攀爬装置,包括:A character climbing device, including:
    确定模块,用于确定与目标角色发生碰撞的障碍物;The determination module is used to determine the obstacles that collide with the target character;
    发射模块,用于在识别确定所述障碍物允许交互且地形满足攀爬条件下,基于所述目标角色向所述障碍物发射检测射线,确定组成所述障碍物的至少一个墙面;A transmitting module, configured to transmit detection rays to the obstacle based on the target character when it is determined that the obstacle allows interaction and the terrain satisfies climbing conditions to determine at least one wall composing the obstacle;
    第一计算模块,用于接收所述检测射线在命中所述至少一个墙面后返回的至少一个法向量,采用所述至少一个法向量计算所述目标角色的角色朝向;The first calculation module is configured to receive at least one normal vector returned after the detection ray hits the at least one wall, and calculate the character orientation of the target character by using the at least one normal vector;
    控制模块,用于获取所述目标角色携带的速度向量,控制所述目标角色按照所述角色朝向以及所述速度向量紧贴所述障碍物进行攀爬。The control module is configured to obtain the speed vector carried by the target character, and control the target character to climb closely against the obstacle according to the direction of the character and the speed vector.
  10. 根据权利要求9所述的装置,所述装置还包括:The device according to claim 9, further comprising:
    第一获取模块,用于获取所述障碍物的实体属性;The first obtaining module is used to obtain the physical attributes of the obstacle;
    第一检测模块,用于当所述障碍物的实体属性指示所述障碍物允许交互时,检测所述障碍物是否允许推动以及是否允许翻越;The first detection module is configured to detect whether the obstacle is allowed to be pushed and whether it is allowed to be overturned when the physical attribute of the obstacle indicates that the obstacle is allowed to interact;
    查询模块,用于若检测到所述障碍物不允许推动且不允许翻越,则查询所述障碍物是否携带禁止攀爬标记;The query module is used to query whether the obstacle carries a climbing prohibition mark if it is detected that the obstacle is not allowed to be pushed and not allowed to be overturned;
    所述发射模块,还用于若查询到所述障碍物未携带所述禁止攀爬标记,则以所述目标角色的中心点为起点,向水平方向发射预设长度的检测射线,并接收所述检测射线返回的检测结果;The transmitting module is further configured to, if the obstacle does not carry the climbing prohibition mark, use the center point of the target character as a starting point, transmit a detection ray of a preset length in the horizontal direction, and receive the The detection result returned by the detection ray;
    所述控制模块,还用于当所述检测结果显示所述障碍物为虚拟爬梯时,控制所述目标角色沿着所述虚拟爬梯的铺设轨迹进行攀爬;The control module is further configured to control the target character to climb along the laying trajectory of the virtual ladder when the detection result shows that the obstacle is a virtual ladder;
    所述发射模块,还用于当所述检测结果显示所述障碍物并非所述虚拟爬梯时,识别确定所述障碍物允许交互且所述地形满足所述攀爬条件。The transmitting module is also used for identifying and determining that the obstacle allows interaction and the terrain satisfies the climbing condition when the detection result shows that the obstacle is not the virtual climbing ladder.
  11. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在服务器上运行时,导致所述服务器执行根据权利要求1-8中的任一个所述的角色攀爬方法。A computer program comprising computer readable code, when the computer readable code runs on a server, causes the server to execute the character climbing method according to any one of claims 1-8.
  12. 一种计算机可读介质,其中存储了如权利要求11所述的计算机程序。A computer readable medium in which the computer program according to claim 11 is stored.
PCT/CN2020/130395 2020-06-22 2020-11-20 Character climbing method and apparatus, computer program, and computer-readable medium WO2021258627A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010573843.6 2020-06-22
CN202010573843.6A CN111714891B (en) 2020-06-22 2020-06-22 Role climbing method and device, computer equipment and readable storage medium

Publications (1)

Publication Number Publication Date
WO2021258627A1 true WO2021258627A1 (en) 2021-12-30

Family

ID=72569922

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/130395 WO2021258627A1 (en) 2020-06-22 2020-11-20 Character climbing method and apparatus, computer program, and computer-readable medium

Country Status (2)

Country Link
CN (1) CN111714891B (en)
WO (1) WO2021258627A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111714891B (en) * 2020-06-22 2021-05-11 苏州幻塔网络科技有限公司 Role climbing method and device, computer equipment and readable storage medium
CN112221147B (en) * 2020-10-15 2024-03-22 网易(杭州)网络有限公司 Obstacle avoidance method in game scene, electronic equipment and machine-readable storage medium
CN112316429A (en) * 2020-11-27 2021-02-05 腾讯科技(深圳)有限公司 Virtual object control method, device, terminal and storage medium
IL305745A (en) * 2021-03-10 2023-11-01 Bungie Inc Markup free ledge grab
CN113509725A (en) * 2021-07-08 2021-10-19 杭州炎魂网络科技有限公司 Two-dimensional game role movement control method and device and storage medium
CN113559516B (en) * 2021-07-30 2023-07-14 腾讯科技(深圳)有限公司 Virtual character control method and device, storage medium and electronic equipment
CN113797543B (en) * 2021-09-27 2023-06-23 腾讯科技(深圳)有限公司 Game processing method, game processing device, computer device, storage medium and program product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1203603A2 (en) * 2000-11-01 2002-05-08 Sony Computer Entertainment Inc. Recording medium, program, program executing system, and program executing device
CN108635853A (en) * 2018-03-23 2018-10-12 腾讯科技(深圳)有限公司 The control method and device of object, storage medium, electronic device
US20190388786A1 (en) * 2018-06-22 2019-12-26 Yacht Club Games, LLC Video Game Gameplay having Nuanced Character Movements and Dynamic Movement Indicators
CN110681156A (en) * 2019-10-10 2020-01-14 腾讯科技(深圳)有限公司 Virtual role control method, device, equipment and storage medium in virtual world
CN111265856A (en) * 2020-01-17 2020-06-12 腾讯科技(深圳)有限公司 Control method and device of virtual operation object, storage medium and electronic device
CN111714891A (en) * 2020-06-22 2020-09-29 苏州幻塔网络科技有限公司 Role climbing method and device, computer equipment and readable storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110665230B (en) * 2019-09-26 2020-11-13 腾讯科技(深圳)有限公司 Virtual role control method, device, equipment and medium in virtual world
CN111068324B (en) * 2019-11-26 2022-05-17 腾讯科技(深圳)有限公司 Virtual object control method, device, equipment and storage medium
CN111330272B (en) * 2020-02-14 2021-12-31 腾讯科技(深圳)有限公司 Virtual object control method, device, terminal and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1203603A2 (en) * 2000-11-01 2002-05-08 Sony Computer Entertainment Inc. Recording medium, program, program executing system, and program executing device
CN108635853A (en) * 2018-03-23 2018-10-12 腾讯科技(深圳)有限公司 The control method and device of object, storage medium, electronic device
US20190388786A1 (en) * 2018-06-22 2019-12-26 Yacht Club Games, LLC Video Game Gameplay having Nuanced Character Movements and Dynamic Movement Indicators
CN110681156A (en) * 2019-10-10 2020-01-14 腾讯科技(深圳)有限公司 Virtual role control method, device, equipment and storage medium in virtual world
CN111265856A (en) * 2020-01-17 2020-06-12 腾讯科技(深圳)有限公司 Control method and device of virtual operation object, storage medium and electronic device
CN111714891A (en) * 2020-06-22 2020-09-29 苏州幻塔网络科技有限公司 Role climbing method and device, computer equipment and readable storage medium

Also Published As

Publication number Publication date
CN111714891A (en) 2020-09-29
CN111714891B (en) 2021-05-11

Similar Documents

Publication Publication Date Title
WO2021258627A1 (en) Character climbing method and apparatus, computer program, and computer-readable medium
KR102506504B1 (en) Voice assistant system using artificial intelligence
Hämäläinen et al. Martial arts in artificial reality
US9981193B2 (en) Movement based recognition and evaluation
US20090104990A1 (en) Game device
US20080096654A1 (en) Game control using three-dimensional motions of controller
US20080096657A1 (en) Method for aiming and shooting using motion sensing controller
US20150165310A1 (en) Dynamic story driven gameworld creation
US10139901B2 (en) Virtual reality distraction monitor
US20210146220A1 (en) Smart soccer goal
JP2001038045A (en) Competition method and device and recording medium
EP3251732A1 (en) Server and dart game device for providing dart game in accordance with hitting area on basis of location of dart pin, and computer program
JP2005319175A (en) Game machine, program, and information storage medium
TW202220731A (en) Method for state switching in virtual scene, device, apparatus, medium and program product
US20200289938A1 (en) Systems and methods for training an artificial intelligence model for competition matches
CN112807681A (en) Game control method, device, electronic equipment and storage medium
CA3168052C (en) System and method for anti-blinding target game
Warren Unencumbered full body interaction in video games
CN113703654B (en) Camouflage processing method and device in virtual scene and electronic equipment
Laakso et al. Design of a body-driven multiplayer game system
CN113018862B (en) Virtual object control method and device, electronic equipment and storage medium
TWI450264B (en) Method and computer program product for photographic mapping in a simulation
KR20090046088A (en) Virtual reality video-game system and playing method of the same
KR102054148B1 (en) system for playing sports-related interactive contents software inducing player's kinetic behavior
KR101977964B1 (en) Apparatus, method and computer for controlling a virtual cricket game

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20942064

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20942064

Country of ref document: EP

Kind code of ref document: A1