• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Hitbox Opinions?

M

Makna

Guest
So, I'm struggling to decide where to place the hitbox in my top-down shmup. The game takes place on the ground, so you don't fly over obstacles, and you can use walls to escape from enemy shots. I made the collisions occur at the bottoms of objects (at the feet/at the bottom of a rock, etc) so you could be on either side of them.
My dilemma is, I'm not sure where to place the hitbox. I was going for a Touhou-style center-of-the-character hitbox, but, then I did the whole collisions thing, and it naturally moved itself to the feet along with the origin I moved.

That brought up the question, should I move it back, or keep it where it is?
If I brought it back, it would look and feel natural, but would clip through walls and cover, and allow bullets to hit it through the rock, as the player character's collisions are at the feet.
If I keep it where it is, it looks weird when visible and would feel unnatural.

What do you think? I made a strawpoll to see what people would be more comfortable with, but if you have any ideas I'd love to hear them too!!

 

Yal

🐧 *penguin noises*
GMC Elder
You can make polls directly in GMC topics, iirc. Not sure if it requires mod approval or not.

I'd say a hitbox placed in the head or chest feels more natural for a "human characters walk on the ground" shooter, since most bullets would fly at around that altitude and the center of the character is the most well defined region. Having it in the chest and then displaying a beating heart when the player focuses (which usually reveals the hitbox) makes it pretty obvious and easy to remember where it is. If getting hit through walls with this placement is an issue, I'd solve that particular case with extra code instead: when you are behind a wall that offers cover, you will ignore hits from bullets that come from that direction. (Suppleant this with bullets being destroyed when they hit a wall, so the "ignore bullets from these directions" code is more of a failsafe). You could display an XCOM-style shield icon in front of the character when you're near a wall that provides cover, giving the player feedback that they're in fact in cover from that direction.

(Also, this goes without saying, but you should use different hitboxes for collisions with bullets and terrain instead of finding one that works okay for both cases - in a bullet hell game there's a conflict of interest, because you want as small of a hitbox as possible for enemy collisions so dense patterns won't feel unfair, but a large of a hitbox as possible for terrain collisions so the player doesn't visibly clip into terrain or slip off terrain when trying to make precise movements when it looked like they still were properly onto it)
 
M

Makna

Guest
You can make polls directly in GMC topics, iirc. Not sure if it requires mod approval or not.

I'd say a hitbox placed in the head or chest feels more natural for a "human characters walk on the ground" shooter, since most bullets would fly at around that altitude and the center of the character is the most well defined region. Having it in the chest and then displaying a beating heart when the player focuses (which usually reveals the hitbox) makes it pretty obvious and easy to remember where it is. If getting hit through walls with this placement is an issue, I'd solve that particular case with extra code instead: when you are behind a wall that offers cover, you will ignore hits from bullets that come from that direction. (Suppleant this with bullets being destroyed when they hit a wall, so the "ignore bullets from these directions" code is more of a failsafe). You could display an XCOM-style shield icon in front of the character when you're near a wall that provides cover, giving the player feedback that they're in fact in cover from that direction.

(Also, this goes without saying, but you should use different hitboxes for collisions with bullets and terrain instead of finding one that works okay for both cases - in a bullet hell game there's a conflict of interest, because you want as small of a hitbox as possible for enemy collisions so dense patterns won't feel unfair, but a large of a hitbox as possible for terrain collisions so the player doesn't visibly clip into terrain or slip off terrain when trying to make precise movements when it looked like they still were properly onto it)
Thanks for the advice, I appreciate it! I added a secondary hitbox without player collision that will spawn on walls, but meant just for bullets. I don't know if it's what I will keep, as you can just camp on walls and protect yourself, but it might be something I end up keeping and using as a gimmick. I'm thinking about it. It's a dilemma, but I'll figure it out. Thanks again!
 

Yal

🐧 *penguin noises*
GMC Elder
as you can just camp on walls and protect yourself
There's a whole slew of ways to combat that:
  • Have enemies flank you and attack from the sides, so you can't avoid damage just by camping at a wall.
  • Have enemies throw grenades or use melee attacks, both of which can go through walls.
  • Have breakable walls, so cover is only temporary.
 
M

Makna

Guest
There's a whole slew of ways to combat that:
  • Have enemies flank you and attack from the sides, so you can't avoid damage just by camping at a wall.
  • Have enemies throw grenades or use melee attacks, both of which can go through walls.
  • Have breakable walls, so cover is only temporary.
Thanks! I'll do all of that, in fact!!
 
Top