theballaam96

DK64R Item Collision

Feb 15th, 2023 (edited)
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. Vanilla DK64 Item Collision is based on spheres with a certain radius and Y Offset relative to the base of the object. For example, Golden Bananas use a sphere of radius 4u and height offset 8u. Because they're spheres, scaling them up to match the Y scale of the object would also scale up their horizontal collision, and as such, cause really strange collision artifacts.
  2.  
  3. With DK64R, this now uses cylinders instead of spheres, allowing us to control both axes independently without overcomplicating the code. The collision for the item begins at the bottom of the object and extends up a certain amount that is pre-determined by us so that the collision mostly reflects the item model. The cylinder is then scaled up based on the scale of the object model relative to some constant for that item type.
  4.  
  5. To prevent some unintended behavior, we've also added in two new conditions in order for an item to be picked up:
  6. - There cannot exist a floor in-between the player and 20 units above the object base. This is to prevent any potential scenario arising with items that are below the player inside a cage being grabbed early.
  7. - The item cannot be grabbed by more than 14 units below the base of the object. This is to prevent items being easily grabbable below floors.
  8.  
  9. We do anticipate that this might change some behavior with regard to glitches. We will look into revising the system and tweaking it based on feedback, including interactions with glitches.
  10.  
  11. If you prefer a diagram: https://imgur.com/ka1QH3p
Advertisement
Add Comment
Please, Sign In to add comment