Devlog #10
Hello guys!
There are 2 types of games, the ones you can crouch and the ones you can't.
Paulo Coelho
One of the things in the game, next to elements such as stairs, elevators, ladders, doors and jumping, which cause many problems for the game developer, is the title crouching. This terse activity in the real world can be problematic at most for the elderly in the game, it is elevated to one of the first things to cut to save time and money.

To look at why this is causing problems, it is first necessary to mention what it might allow. Only 3D games will be considered because the two-dimensional games are a different story and different rules. First, crouching reduces height so they can avoid enemies or projectiles, be less visible, or enter tight spaces. These are quite easy to see benefits that work for specific types of games. Secondly, which is more problematic, getting up from a crouch increases the character. Games and their physics are often unreliable and stop working when you least expect them.
Shooters, especially first-person shooters and stealth games, must be able to crouch, but they often work on simplifications that reduce the openings to two levels. Standard openings must be the size of a door, and those smaller than the character must allow the player to crouch. Otherwise they would be considered poorly designed and frustrating the player. The standard size of the obstacle should reveal a standing person, but cover a crouching person.
How is crouching done in games? There are several approaches to this, and there is a difference between first and third person games. In the case of the view from the eyes, it is of course important to lower the camera. After all, what the camera does not see, the opponents should not notice. The transition of such a camera must be smooth so as not to cause nausea. In third person, a similar effect is often achieved by bringing the camera closer to the player's character. The perspective from behind the character, of course, requires an appropriate animation of transition between states of motion. Here, the mere movement of the camera so that no models are caught in it can be a certain gymnastics for the programmer. The second more problematic element is the change of the collision area.

What is the collision area? In short, it is a lump around the player that prevents him from falling under the floor, going through walls or punching his head through the ceiling. All those elements that are supposed to block the player's passage are the collision areas. When something is broken in them, due to the inattention of designers who forgot to insert such an area in a given place, or due to a wrong calculation made by the game engine, the character may fall under the map or be launched into the air. If the computer had to operate on a large number of more complicated bodies than capsules and prisms, its performance would drop significantly, and 60 FPS can be forgotten.
A lot of the events in the game are based on triggers. A trigger is an area where when a player or other object (which is up to the developers) appears, the game does something. That something could be, for example, a dialogue sequence. You can imagine such a situation, the player is thrown into the air to the full height. When it reaches a certain level, it bumps its head into the appropriate trigger, and a conversation starts. What if it is quite high, and our character crouches when he reaches the maximum height. Dialogue will never come on and it is hardly possible if it is only a dialogue, and not, for example, the sequence of opening the door or moving the platform, which was supposed to prevent us from falling into the abyss.

Since you know what collisions are and what problems they can cause, you can move on to what and how to do with them.
One approach is to create 2 separate collisions, one for a standing person and one for a crouch, and switching them alternately. The second way is to hold one collision and change the altitude. The problem with changing the height is that it is scaled to the center. So it is not that the height is taken from the top, but from the bottom and the top at the same time. Then the figure seems to drop a little.

The next problems are the places where the character can stand up. You have to make sure that you cannot get up when you have something over your head. Each time the character wants to get up, check if any fragment of the collision has any obstacle directly above it. What, as you can guess, can often cause various kinds of sticking into elements that should not be hammered into.
Multiplayer games have even developed a certain language with the use of simple interactions
Crouching - getting attention
Crouching on the face of a dead figure - contempt and disrespect
Jumping around - Hello, friend of the player
Shooting at you - urgent attention
Shooting at you then shooting in some direction - Go there
Punch with a fist - Move it *****
Fast turning - I'm bored
In games with no clear faction breakdowns, a few squats can mean you want an alliance
We would also like to invite everyone to our Discord where we will be happy to answer all your questions about the current work - DISCORD
Why game developers hate crouching?
There are 2 types of games, the ones you can crouch and the ones you can't.
Paulo Coelho
One of the things in the game, next to elements such as stairs, elevators, ladders, doors and jumping, which cause many problems for the game developer, is the title crouching. This terse activity in the real world can be problematic at most for the elderly in the game, it is elevated to one of the first things to cut to save time and money.

To look at why this is causing problems, it is first necessary to mention what it might allow. Only 3D games will be considered because the two-dimensional games are a different story and different rules. First, crouching reduces height so they can avoid enemies or projectiles, be less visible, or enter tight spaces. These are quite easy to see benefits that work for specific types of games. Secondly, which is more problematic, getting up from a crouch increases the character. Games and their physics are often unreliable and stop working when you least expect them.
Shooters, especially first-person shooters and stealth games, must be able to crouch, but they often work on simplifications that reduce the openings to two levels. Standard openings must be the size of a door, and those smaller than the character must allow the player to crouch. Otherwise they would be considered poorly designed and frustrating the player. The standard size of the obstacle should reveal a standing person, but cover a crouching person.
How is crouching done in games? There are several approaches to this, and there is a difference between first and third person games. In the case of the view from the eyes, it is of course important to lower the camera. After all, what the camera does not see, the opponents should not notice. The transition of such a camera must be smooth so as not to cause nausea. In third person, a similar effect is often achieved by bringing the camera closer to the player's character. The perspective from behind the character, of course, requires an appropriate animation of transition between states of motion. Here, the mere movement of the camera so that no models are caught in it can be a certain gymnastics for the programmer. The second more problematic element is the change of the collision area.

What is the collision area? In short, it is a lump around the player that prevents him from falling under the floor, going through walls or punching his head through the ceiling. All those elements that are supposed to block the player's passage are the collision areas. When something is broken in them, due to the inattention of designers who forgot to insert such an area in a given place, or due to a wrong calculation made by the game engine, the character may fall under the map or be launched into the air. If the computer had to operate on a large number of more complicated bodies than capsules and prisms, its performance would drop significantly, and 60 FPS can be forgotten.
A lot of the events in the game are based on triggers. A trigger is an area where when a player or other object (which is up to the developers) appears, the game does something. That something could be, for example, a dialogue sequence. You can imagine such a situation, the player is thrown into the air to the full height. When it reaches a certain level, it bumps its head into the appropriate trigger, and a conversation starts. What if it is quite high, and our character crouches when he reaches the maximum height. Dialogue will never come on and it is hardly possible if it is only a dialogue, and not, for example, the sequence of opening the door or moving the platform, which was supposed to prevent us from falling into the abyss.

Since you know what collisions are and what problems they can cause, you can move on to what and how to do with them.
One approach is to create 2 separate collisions, one for a standing person and one for a crouch, and switching them alternately. The second way is to hold one collision and change the altitude. The problem with changing the height is that it is scaled to the center. So it is not that the height is taken from the top, but from the bottom and the top at the same time. Then the figure seems to drop a little.

The next problems are the places where the character can stand up. You have to make sure that you cannot get up when you have something over your head. Each time the character wants to get up, check if any fragment of the collision has any obstacle directly above it. What, as you can guess, can often cause various kinds of sticking into elements that should not be hammered into.
Multiplayer games have even developed a certain language with the use of simple interactions
Crouching - getting attention
Crouching on the face of a dead figure - contempt and disrespect
Jumping around - Hello, friend of the player
Shooting at you - urgent attention
Shooting at you then shooting in some direction - Go there
Punch with a fist - Move it *****
Fast turning - I'm bored
In games with no clear faction breakdowns, a few squats can mean you want an alliance
We would also like to invite everyone to our Discord where we will be happy to answer all your questions about the current work - DISCORD