What are hitboxes, how they work and in-game design

Hitbox là gì, cơ chế hoạt động và cách chúng được thiết kế trong game
Hitboxes are hidden cubes that signal the game when objects in the game come into contact with each other.
Hitbox has always been an essential and always present mechanism in every game. A good game will make you unable to recognize their existence

When you ask a game developer about a hitbox, you’ll get mixed reactions. One person replied, “Ugh, hitbox.” Another replied: “I have been obsessed with this mechanism for 20 years.”

While hitboxes have become indispensable for every game, the process of setting up their mechanics has always been complicated and odd. Hitbox always has to balance between recreating what’s going on in the game and fairness for players. The mechanics had to make the game work the way the player intended, and that created a series of challenges in the design process. When will the actual hitbox be different from what we see and guess, when the hitbox just needs a simple design, in which case it has to be detailed down to the hair. In short, creating a good hitbox is difficult and it is a problem that game developers always face.

What are hitboxes, how they work and how they are designed?
Sometimes it’s very simple to make a hitbot, just a few square blocks covering the character are enough
What are hitboxes, how they work and how they are designed in the game
But sometimes Hitbox has to be extremely detailed to ensure the objectivity of the game

What is Hitbox?

There’s every reason the game needs to know about hitbox mechanics in games. You have to know how the Street Fighter hitbox is designed to hit your opponent while keeping a safe position. Or when you guess and successfully pass the thorns in Super Meat Boy. Or why miss when the reticle has headshot (in the head) the opponent in Rainbos Six: Siege.

If you’ve ever programmed a game, you know that the Hitbox mechanism works in a bidirectional way. You need to have a hitbox that describes the throwing of punches or bullets, called the hitbox responsible for the attack. On the contrary, there must be another hitbox responsible for receiving, often called “hurtbox”. Because collision always requires two things acting on each other. But no matter what type of hitbox they are, the mechanism by which they work is not uniform. Different games have different approaches to hitbox shape, size, and behavior.

For example, the character hitbox in Dark Souls is almost identical to the character model that appears when you move. It is so accurate that you can dodge several attacks just by changing your stance. In the following example of speedrunner catalystzhe managed to dodge Gravelord Nit’s Greatsword by timing his legs wide enough to prevent the sword from hitting him.

According to SD Shepard“In World, they make the hitbox very detailed and specific to the monster,” said Monster Hunter speedrunner, streamer and North American Monster Hunter World Champion.

Hitboxes have become a very basic thing in many games, forcing the player to keep an eye on them, to feel their shape and fluidity.

“95% of the time I play games I think about them!” SD Shepard said. “A lot of people surrender to Monter Stunter because they are afraid of not knowing how to use their weapons. But let me put it bluntly, weapons are just a very simple element. When I tried to show them a better way, I told them instead of fighting monsters to watch the monsters move. When it does attack, see how far away you need to stand so it doesn’t hit you or to dodge enough distance.”

With third-person 3D action games, the hitbox has to match the character’s body. Understanding this will help you adapt to the design of the game and thereby learn how to play better.

For Shmups (an airplane shooting game), a different approach is applied. Their hitbox is usually smaller than the player character (or plane) to help you dodge the bullets on the screen. Keeping the hitbox right with the size of an airplane will make the game a lot more difficult and annoying. Another example is the indie game Blue Revolver, which also chooses a very small aircraft hitbox.

Hitbox trong game hoat dong the nao - Emergenceingame
See the little red dot in the middle? It’s the plane’s hitbox

Game with action music theme Endlights is more different. In Endlight, your spaceship has up to three hitboxes and it depends on the situation. The hitbox hitting the wall will be smaller than what you see so you have plenty of room to wriggle around. The hitbox to touch the targets you are aiming for will be slightly larger, giving the player a better feeling. And another hitbox three times the size of your spaceship, which will generally trigger a “whoosh” sound when you fly close to walls and obstacles. As you can see not all hitboxes are for combat.

(Actually, the “whoosh” hitbox comes in two sizes. At times it is 10 times larger than your spaceship, when a large obstacle collides with the boat it will trigger a whoosh sound. Small objects will only whoosh when they are in place. close, and the big whoosh are further away.In general, complicated hitboxes!)

Design cool hitboxes

Disc Room use hitbox and place them on high speed rotating saw blades and when you craft(tap on them) they will activate special effect. When you get close to the saw blades, the main character will have a jerk, there is a sound and the time in the game will slow down to emphasize the moment (this part is related to the player’s experience). You can watch the video below to better understand what is described.

Jan Willem Nijman, one of the game’s programmers said: “It was created to warn of danger and give you time to react. Basically, we want fun moments to happen as often as possible. It gives a sense of euphoria when you get out of a dilemma instead of simply dying too easily.”

These saw blades are a good example of hitbox diversity: the area of ​​the saw disc that deals damage doesn’t extend as far as the saw blade. And faster saw blades will have even smaller hitboxes.

What are hitboxes, how they work and how they are designed?
The gray circle in the right picture is the actual hitbox of the saw disc

The Disc Room hitbox is available for a fixed period of time. “You are allowed to touch the hitbox for up to 50 milliseconds, about three frames, before dying (if you touch it longer, the character dies). It’s not a long enough reaction time, but it does provide good effects to make players think the game knows what you’re up to.”

That’s what hitbox tries to do to make the game play out exactly what you expect. That means it varies from game to game, so the design and application of the hitbox cannot be universal. Nijman and team also go into more detail: When the character is dodge roll, should change the time to touch the disc? As time slows down, shouldn’t the player’s hitbox get smaller?

“We have not come to a final conclusion and will probably continue to explore and explore until the end of the project.”

Optimize hitbox

What are hitboxes, how they work and how they are designed?

Developer Metanet spent 10 years tweaking the hitbox for the classic ninja platform game N, before the final weeks of the game. N++. “The collision with the gold block becomes a bit bigger, the mines are a bit smaller so that the game is not too annoying and entangled,” said Mare Shappard.

“You come up with a plan for how you want things to happen, and these small changes make the plan more likely to succeed, but don’t make the game unreasonably difficult or too easy.”

Developer Julian Spillane repeated this process while developing the fighting game Mighty Fight Federation just launched Early Access this 2020. Players quickly complained about a character in the game when he required to get close to deal damage, it was too weak and had no ability to close that distance.

“I realized it had nothing to do with that,” Spillane said. “The hitbox for the character’s punch is not wide enough for the character to hit on the first shot, so the combo cannot be created. Although it is absurd that the punch has a big hitbox, but because the character has nothing else, it forced us to make the hitbot bigger.

Hitbox is made by where?

Even though they are called Hitboxes, they are not always “boxes”. In Dark Souls, Monster Hunter World, and Apex Legends, hitboxes follow character shapes. In other games, from platfrom to fighting, they have many shapes: circle, diamond, capsule.

Fighting games often use square hitboxes shaped from Street Fighter 2, while Marvel vs. Capcom uses a circle. In the 3D fighting game Mighty Fight Federation, they are circular and rarely use squares. “With the right angle, you have too much misinformation relative to the character’s shape,” says Spillane.

In platform games, they are usually circular. The circular hitbox makes the N++ game feel more natural: ninjas often curl up when jumping, circles are better than using other shapes to slide or pass through other objects.

“If you look closely, there are a lot of gaps in the circle. And looking at each frame, you will see that the character is still hit even though sometimes the character does not touch them” – Raigan Burns of Metanet Software shared. “But people don’t really pay attention. Then you will realize that there is a safe radius around yourself.”

CALCULATION TO BUILD HITBOX

Hitbox trong game hoat dong the nao 3 - Emergenceingame

While hitbox design is quite easy to understand, its technical side is a confusing science.

“This is something I’ve been obsessed with for 20 years,” Burns said. “It is an open matter. No one can solve it. I feel like I finally understand what makes it so complicated, but I don’t know if I can explain it.”

The gist: While we humans can understand the concept of one thing colliding with another, calculating it is far from easy. And the number of collision events a game needs to calculate is unbelievable.

Take Doom Eternal as a simple example: in each frame, the game has to check the player’s hitbox against the ground or each wall, then monsters and other objects. The game also has multiple hitboxes for each monster so that they react to different projectiles. And each bullet and bullet must leave a mark when it hits walls, floors and objects. We’re talking about thousands of things to check in a single second.

With Endlight, a game with a lot of objects on the screen at once, developer Jim McGinley had to optimize the game to reduce the number of checks on immobile objects and ignore objects that are too far away from the player. Because the game is designed in the style of a carousel, McGinley knows that each object takes 20 seconds from the moment they appear until they reach the character. So they’re only awarded hitboxes when they’ve been alive for 18 seconds (he calls it “Endlight’s Best Initiative” for the importance of this little idea).

We have another problem, most games will do the calculation for each frame, so sometimes something will be missed. The computer will interpret the objects as not colliding, since that moment takes place between frames. Imagine every second the game would check the hitbox of objects, then accidentally the bullet you fired was in the middle of each check and the result was that the enemy was alive. Is this the reason that CSGO has the legendary shooting error that Valve can’t fix forever?

The game’s solution is to look back at the object’s direction one frame in advance. If the direction of travel intersects with another object, they will collide. The truth is that making a game is like a simulation, the job is to fool us into thinking that everything collides with each other.

“Everything in the game is about perception and they are tricks to fool us in every frame,” says Spillane. When hitboxes are sloppy, games become unjustifiably unfair and they break expectations from players. “I don’t think anyone has perfected the hitbox design formula, but it’s clear that there are many games that make players feel better than others by simply hittingbox mechanics.”

“When hitboxes are well designed, you don’t have to worry about them. It will feel exactly what you think and anticipate.” – Nijman

You can read other articles related to this topic The art of making games here:

Source link: What are hitboxes, how they work and in-game design
– https://emergenceingames.com/

Leave a Reply

Your email address will not be published. Required fields are marked *