SuperTux / supertux

SuperTux source code
https://supertux.org
GNU General Public License v3.0
2.54k stars 492 forks source link

Rotating hitboxes [HELP WANTED!] #1448

Open Rusty-Box opened 4 years ago

Rusty-Box commented 4 years ago

Something that would be really benefitial is having rotateable hitboxes (for mechanics like swimming, swinging on ropes, rotating platforms etc.).

If you know how to do it in C++ we would be thankful for your help and support!

Rusty-Box commented 4 years ago

Ping to our known coders, in case one of you has some knowledge to share - @tobbi @HybridDog @Zwatotem

Zwatotem commented 4 years ago

I have my algorithms & data structures course (including geometry algorithms) semester ahead, so I don't know. I'd probably be able to do something with rectangles, but no physics.

Zwatotem commented 4 years ago

What about going straight for convex polygons? Since this is an occasion for changes, maybe do it right away, and not rise similar issue in a couple months? I mean, if you can't really predict any usecase for polygon hitboxes, then we'll stay with rectangles, but otherwise I think it's worth it.

Rusty-Box commented 4 years ago

@Zwatotem What would be the benefits we get through polygon hitboxes compared to rectangles?

Zwatotem commented 4 years ago

I think some larger creatures object like bosses could be better modeled. Although in most cases I can think of they would require concave polygons, some things (like a large snowball featured rarely in bonus levels) gain on this undoubtly.

HybridDog commented 4 years ago

Although in most cases I can think of they would require concave polygons […]

That's probably not a problem because often those concave polygons can be decomposed into smaller convex polygons.

A polygon could be used for this spike, but it would break backwards-compatibility. I'm sometimes wondering how it is possible to get hurt by this almost 60 degree spike. up

Alzter commented 4 years ago

Not strictly related to polygon hitboxes, but these single sided spike tiles will hurt you from any angle. You can jump and hit your head on the wood block part of this spike and it'll hit you. On top of this spikes aren't solid blocks which is odd.

tobbi commented 1 year ago

Do you really think priority urgent is necessary here?

Rusty-Box commented 1 year ago

Not anymore really. While I'd still consider it urgend to have it for stuff like swimming and, which has rotating sprites, we have functional alternative for the time being. So yes and no.

tobbi commented 1 year ago

Better?

tylerandari13 commented 1 year ago

Not anymore really. While I'd still consider it urgend to have it for stuff like swimming and, which has rotating sprites, we have functional alternative for the time being. So yes and no.

Tbh i feel like swimming with a rotating hitbox would be very annoying.

Rusty-Box commented 1 year ago

Don't know how since the hitbox will match Tux's actual sprite so it is even more predicatable when you get hit or not

tylerandari13 commented 1 year ago

Don't know how since the hitbox will match Tux's actual sprite so it is even more predicatable when you get hit or not

I guess for me it depends how Tux reacts when he turns around and his hitbox crashes into a wall.