Hitbox issues

For questions about using Classic.

Post » Wed Dec 09, 2009 4:51 pm

Okay so once again referring to the Touhou games, the game can use a ton of bullets because of small hitboxes, the main hitbox is just a pixel and since I have the option that works fine but when it comes to bullets of it gets weird, if I go with per pixel then their too big, and bounding box is even worst obviously, can I make like a certain box withing a bullet for the hitbox?

Info:

All graphics for bullets are in the same bullet object, as frames, id need to be able to change said bounding box
there are many bullets onscreen, so this process should not take much CPU
B
2
G
3
Posts: 32
Reputation: 914

Post » Wed Dec 09, 2009 6:38 pm

I think if you make two objects, a much smaller one and use a bounding box for that, and then the larger bullet sprite, and no collision for that. Make them a container of each other, and spawn the smaller one, make that always invisible, and instance a copy of your actual bullet sprite on top of it. That should work.

I think deadeyes platform tutorials mention something along those lines involving using another object as the collision box rather than the actual sprite. So you might wanna check those out as that's what you're looking for.
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Wed Dec 09, 2009 7:41 pm

It might not be a good idea to make separate hitboxes for bullets in a bullet-hell shmup.

If you want tiny, 1-px hitboxes then why don't you use Point collision? It basically turns the hotspot into the only collideable point.

Or, if your bullets are only one frame, then you may be able to re-draw the collision mask for them.

Moved thread to Help/Tech
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Dec 09, 2009 7:58 pm

[quote="deadeye":7usb0yq2]It might not be a good idea to make separate hitboxes for bullets in a bullet-hell shmup.

If you want tiny, 1-px hitboxes then why don't you use Point collision? It basically turns the hotspot into the only collideable point.

Or, if your bullets are only one frame, then you may be able to re-draw the collision mask for them.

Moved thread to Help/Tech[/quote:7usb0yq2]

He said it goes weird when using point collision, that's why I suggested the alternative. Besides, doing so would slow it down, and that would be best for all bullet hell games *grins* ;)


No seriously though, why not do what a lot of them do and rather than change the collision of the bullets, shrink the collision area of the player, would achieve the same effect in the end, wouldn't it. I think Progear was one that did that (only comes to mind cause I was playing it earlier heh).
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Wed Dec 09, 2009 8:07 pm

[quote="Lost my Keys":n8l9mm0c]He said it goes weird when using point collision, that's why I suggested the alternative. Besides, doing so would slow it down, and that would be best for all bullet hell games *grins* ;)[/quote:n8l9mm0c]

Hmm... I guess you can read run-onish better than I. It looked to me like FS tried Per Pixel and Bounding Box, but I see how you might have been able to translate more with the Lolsetta Stone.

My mistake :)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Dec 09, 2009 8:12 pm

[quote="deadeye":cj61r0bw][quote="Lost my Keys":cj61r0bw]He said it goes weird when using point collision, that's why I suggested the alternative. Besides, doing so would slow it down, and that would be best for all bullet hell games *grins* ;)[/quote:cj61r0bw]

Hmm... I guess you can read run-onish better than I. It looked to me like FS tried Per Pixel and Bounding Box, but I see how you might have been able to translate more with the Lolsetta Stone.

My mistake :)[/quote:cj61r0bw]

Bah, now you got me wondering if I read it wrong too lol. When he said the main hitbox was just a pixel, I assumed he meant the point/single pixel collision method and didn't actually create one of a single pixel.. or maybe he did, gah hahaha.

Edit: I'm gonna take a guess that the weirdness is along the lines of bullets going through things cause of there being so many things on screen and frame rate suffering. But I don't know enough about this timedelta thing to suggest a fix, assuming that's the problem anyways.
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Wed Dec 09, 2009 9:32 pm

You cant get per pixel on anything less than 2 pixels, so yeah point would be better.
If your ship isn't terribly oblong you could try distance(x1,y1,x2,y2). Something like:
system compare distance(bullet.x, bullet.y, ship.x, ship.y) is less than ship.width
>bullet destroy
or what ever

Distance works off of the image point, so as long as it comes within that circumference it should work.
Other wise the only other thing you could try is instant hit with step, but that would be best with a percentage type of system... wouldn't really work with a bullet hell shump.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests