Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

After trying out everything you said,  checking the weird cylinder I realized that my sprite origin for the cylinder object was at 0,0 instead of in the middle center, fixing that seems to have solved this ... so I guess the sprite's offset somehow messes up the cylinder's collision boundary? Sorry, that was my bad! 😭(I'm still learning how this collision-checking grid works... :P)

I also have a question in regard to the player hitboxes - when I change the hitbox_radius variable in the player object, it doesn't change how close I can get to the terrain model, I can still kind of clip through it a bit (it stops at the player's exact x/y coordinate). How would I expand this to cover my entire bird character's model? 

I'm working off of the OpenWorld project since that one is more up-to-date and includes extra stuff like the WMHM and footstep sounds, but since it uses a 2D flat sprite for the character, I want to bring back the 3D model collision that the legacy version uses. Did it use a 3D AABB/cylinder for Super Maria? How did you make sure that it avoided clipping through terrain?

(2 edits)

Ah... yeah, the code assumes the origin for cylinders is in the center, so having it be in the top left corner will offset everything by the radius amount on both axes. Glad that got sorted out in the end at least. 

The player movement (the vast majority of movement is done in psbp_inertia_horizontal / psbp_inertia_vertical) mainly uses two functions, terrain_hit_pilloid_cheap and slope_hit_optimized, the latter of which in turn uses terrain_buffer_lookup_verticalslice. Both of these intentionally just check 3 points (XY center @ Z bottom, Z top, and Z centerpoint) since collision checking turned out to be the most expensive operation in the game. But there's a dummied-out alternate version of terrain_hit_pilloid_cheap that does check the full 12 points (taking the radius into account). Replacing the 3-point version with this, and then using slope_hit_pilloid_cheap in the player inertia functions instead of slope_hit_optimized, should restore the old collision checking as it was. (Note that slope_hit_optimized uses a z height argument that slope_hit_pilloid_cheap doesn't use so you might need to remove that to avoid GM complaining about passing too many arguments)