Hitboxes: lazy/bad programming or best idea ever?

This is the main shmups forum. Chat about shmups in here - keep it on-topic please!
User avatar
Obiwanshinobi
Posts: 7470
Joined: Sun Jul 26, 2009 1:14 am

Re: Hitboxes: lazy/bad programming or best idea ever?

Post by Obiwanshinobi »

Is Psyvariar a shooter, though? That is a question. More like graze 'em up.
The rear gate is closed down
The way out is cut off

Image
User avatar
ciox
Posts: 1008
Joined: Sun Feb 12, 2012 5:29 pm
Location: Romania

Re: Hitboxes: lazy/bad programming or best idea ever?

Post by ciox »

Obiwanshinobi wrote:Is Psyvariar a shooter, though? That is a question. More like graze 'em up.
Psyvariar 2, the more visible game of the series, has very weak level design where you are discouraged from shooting.
In the originals shooting is very important for score and survival as clearing a level with 100% destruction gives you both a huge point bonus and a bomb, and the enemies are designed so they fire and then briefly leave themselves vulnerable to be shot, the way you hold back from destroying enemies too early is reminiscent of DDP chaining, but you are definitely firing and chasing enemies all over.
Well whatever, just watch ISO's superplay of Revision if you don't believe me. (youtube or dvd from the ps2 version)
User avatar
Ed Oscuro
Posts: 18654
Joined: Thu Dec 08, 2005 4:13 pm
Location: uoıʇɐɹnƃıɟuoɔ ɯǝʇsʎs

Re: Hitboxes: lazy/bad programming or best idea ever?

Post by Ed Oscuro »

Drake wrote:You wouldn't be able to do that effectively with a shipbox for a few reasons. Immediately, the proximity and density restrictions that come with a larger hitbox does limit what you can throw at the player without your pattern turning to garbage.
The only problem here is that a pixel-accurate hitbox (I didn't call it a "shipbox") is an arbitrary shape whose boundaries seem less easy to predict than seen with a box or circle. However it would be a simple matter to make only the central ovoid portion, in the case of a traditional fighter plane design, register a hit; other portions (i.e. wings) could trigger grazing. By no means does having pixel-accurate detection limit you to an inobvious hitbox design.

There are times where a hitbox is not the most obvious or helpful in registering hits:
Image
Ignoring the ridiculous placement of the hitboxes in this example, a couple triangles would match the shape much better. For that matter, by definition so would pixel-accurate detection.
User avatar
Drake
Posts: 144
Joined: Sun Jan 30, 2011 10:21 pm

Re: Hitboxes: lazy/bad programming or best idea ever?

Post by Drake »

I'm confused as to what you're suggesting or arguing against me about. I use "shipbox" simply to mean when the collision area of your ship is the whole ship, whether a rectangle or circle or bitmap, i.e. what Jeneki was asking about to begin with. With your example of "only the central ovoid portion registers a hit", that's a hitbox, and the wings are the grazebox. Maybe you're mistaking that when I say "hitbox" I mean only rectangles?
I'm not talking about pixel-accuracy at all either, in fact I was just earlier talking about how pixel-accurate detection isn't really all that accurate. I totally agree with the triangle suggestion in that fireball example, but given the curving shape and the likely speed of the fireball I would suggest several circles instead, and the end of the tail having no hitbox for some leniency.

you make it seem as though you're disagreeing with me when what you say isn't disagreeing with me idgi

I was going to bring up Psyvariar earlier but eh. Personally I don't think it's pertinent to talk about Psyvariar in the context of grazing since I find it treads the line between grazing and being some other system entirely. You can look at it for ideas but when you're mashing yourself into the bullets for points I don't really call that grazing anymore.
Image
User avatar
Ed Oscuro
Posts: 18654
Joined: Thu Dec 08, 2005 4:13 pm
Location: uoıʇɐɹnƃıɟuoɔ ɯǝʇsʎs

Re: Hitboxes: lazy/bad programming or best idea ever?

Post by Ed Oscuro »

Jeneki's real question was "how can these things be done?" Rather than say "well it can't be done," I showed a way it could. I think that's useful.

There are lots of alternate possibilities that would still be possible within a "full sprite hit detection" (sorry, I can't bring myself to write "shipbox" with a straight face) system. You could use a penetration system, whereby the number of pixels that collide with the enemy bullet count towards a graze score unless the number of sprite pixels crossed reaches a certain threshhold. If the ship escapes fatal damage, then graze points could be triggered (or, to sync proper timing of graze animation / effects, the number of pixels crossed could be precalculated I suppose). You could even use this towards cosmetic damage calculation. Elegant? Not really...coherent, though, definitely.
User avatar
Drake
Posts: 144
Joined: Sun Jan 30, 2011 10:21 pm

Re: Hitboxes: lazy/bad programming or best idea ever?

Post by Drake »

When he says "full-sprite hitbox", I don't consider what you said before a solution, since having only the ovoid be fatal is uh exactly not being a full-sprite hitbox. You also went into some completely different thing about pixel-perfect detection so that was confusing too. The penetration idea sounds coherent though, even if I don't think it would work very well at all, so I concede that. Kind of tiptoes around what I'd consider a hitbox, but it's an answer nonetheless.
Image
User avatar
Ed Oscuro
Posts: 18654
Joined: Thu Dec 08, 2005 4:13 pm
Location: uoıʇɐɹnƃıɟuoɔ ɯǝʇsʎs

Re: Hitboxes: lazy/bad programming or best idea ever?

Post by Ed Oscuro »

Drake wrote:When he says "full-sprite hitbox", I don't consider what you said before a solution, since having only the ovoid be fatal is uh exactly not being a full-sprite hitbox.
You sometimes have to break the suggestion in a subtle, but acceptable, way. I do seek (and I don't think I made any error) to keep the terms accurate and not misleading in themselves, of course. It would be nice if people clearly differentiated between hit and graze areas, but what is also important is that the tangential niceties of respecting the terminology should not override the discussion of the technical possibilities. I believe that Jeneki's comment, following directly after your discussion with boagman, was not meant simply as "the whole ship detects a solid hit and nothing can be done to alter this" because that stops the discussion dead. But it would be even worse to make it appear, due to the confusion about what is meant by the word, as if there aren't other possibilities.

And still, it might not be as consistent for gameplay or performance purposes as we'd like, but radius or penetration depth detection, or hybrid uses of a hitbox, would almost seem to technically fit the bill of allowing both a "full sprite hitbox" while still having dual roles. I wouldn't suggest that it is great to refactor the problem just to fit the terminology, which is why I have tried to focus on what is possible rather than "he said, she said" type stuff leading nowhere. I hope this is a satisfactory response.
Post Reply