theballaam96

DK64 Model 2 Hitboxes explained

Aug 16th, 2022 (edited)
511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. Why DK64 object hitboxes can be so weird?
  2. (Yes, including that one Tiny CB in Aztec)
  3.  
  4. Donkey Kong 64 splits object model 2 (Objects which are spawned into the world upon map initialization rather than when you get close to them. These include colored bananas, most golden bananas, coins, crystals/ammo/orange/film pickup) into 500x500 squares along the X and Z axis. Presumably this splitting is to reduce lag as the game has to iterate through less items to check collisions if it's filtering through them by coordinates.
  5.  
  6. Whilst this is a great system and a clever way of reducing lag, it's not without it's quirks. For example, even if you are within an object's hitbox (which is a sphere centered around a certain point), if you are not within the same 500x500 square as the object, the game won't check for collision with that object and therefore can't detect whether you are collecting it.
  7.  
  8. As shown here: https://imgur.com/s1rzIVS, this can mean that as little as 25% of the hitbox sphere will work, which is obviously not great.
  9.  
  10. This is also why that one Aztec Tiny CB's hitbox is so weird, the hitbox lies at x=3500, z=3123. Meaning that half it's hitbox isn't active because it lies within a different square to where the colored banana is. With some rough approximation, the grid barrier is like so: https://imgur.com/CNeTN9Q , as such, the left 50% of the hitbox is the only side which is active.
  11.  
  12. ------------------------------------
  13.  
  14. TL;DR: Donkey Kong 64 only checks hitboxes if it's in the same 500x500 square as where the object is located. As such, this can lead to oddities where part of a hitbox is outside of it's home square and therefore the hitbox is inactive for that portion of the hitbox.
  15. Also hitboxes are spheres.
Advertisement
Add Comment
Please, Sign In to add comment