Wrong NPC hitboxes [SOLVED]

Lx Xzit M
Topic author, Moderator
Moderator
Avatar
Lx Xzit M
Topic author, Moderator
Moderator
Reputation: 402
Posts: 757
Joined: 9 Nov 2015
Website
  • 1

Post #1by Lx Xzit » 14 Aug 2016, 3:11

I've got a lot of unfair hits in SMBX 1.4 when I was smashing enemies but I never understood why, then I made a deep research and I found the problem: The NPC hitboxes in SMBX 1.4.2 are TOO exact, so if you accidentaly stomp and enemy 1 pixel below than you should, you will get damage. This doesn't happen in SMBX 1.3 or in other Mario games. :P

This rather a problem is a suggestion that personally I'd appreciate a lot because It'd avoid a lot of unfair hits/deads, also it would make the gameplay more comfortable and polished. My suggestion is: Make the hitboxes of the NPCs exactly or nearly like in SMBX 1.3.

The NPC hitboxes in SMBX 1.3 works with the follow way:

Spoiler
Image
Image

What is this? It's a standard goomba without any modifications of the size. I painted it pink and green to understand better how do the hitboxes works at SMBX 1.3.
In these images you can see the EXACT limit, the closest the player can stay without get damage, if I had moved a pixel below or more to the right it would have been hurt.

The "Pink zone" of the NPC is the standard size of it (32x32), this size will be taken into count when the NPC receive any kind of damage (jump, spin jump, fireballs, shells, etc.). The "Green zone" of the NPC shows the area where you will get damage if you touch it.

Image

Then, how to fix this problem exactly? The hitbox of a NPC should be divided into two parts as SMBX 1.3. With a part little of the hitbox you won't be hurt. To make this work for all NPC (even the custom ones) these things should be taken in count:

  • The total size of the NPC should subtract 9 pixels high (independently of the size the NPC is). So if the NPC is 32 pixels height, then the "damage zone" for the player should be 23 pixels (and so on).
  • 2 pixels less of the total width of the NPC: 1 pixel is subtracted from the left side and 1 pixel to the right.

(This only should apply with the NPCs the player can smash, of course.)

Here's the example level:
NPC hitboxes problem.zip
(1.01 KiB) Downloaded 196 times

If you test this level in SMBX 1.4 you will noticed that with the minor touch of the NPC you will get damaged, when in SMBX 1.3 it doesn't.
VISIT MY YOUTUBE CHANNEL! LX XZIT
Join our 38A Discord server!

Image

Return to “Troubleshooting”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest