Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Yal's SoulsVania Engine

Metroidvania / Soulslike project for GameMaker:Studio · By Yal

Fallthrough Platforms - how should I integrate them with this engine?

A topic by Game Soup LLC created Apr 11, 2021 Views: 206 Replies: 1
Viewing posts 1 to 2
(+1)

I'm absolutely loving this engine so far. One thing I really want is fallthrough platforms, which are difficult to get just right in my experience.

Since they're conditionally solid depending on your direction, they require a more complex check than position_meeting() if they're checked in the function pixel_vacant() along with terrain and tiles.

I realize there's probably nothing about this engine that mandates a special kind of integration of fallthroughs, but because the engine itself is so clean, I'd love to see an implementation that doesn't totally break other parts of the engine (because that's what my implementations tend to do).

Developer (1 edit)

In my experiences, the easiest way to handle jumpthroughs is something like this:

  • If you're moving upwards (yspeed < 0), do nothing
  • Else, if current position is colliding with a jumpthrough, do nothing, because this means we're currently falling through one we didn't land on
  • Else, treat them as normal solid platforms and return true if the to-be-checked point is a jumpthrough.

checking the calling instance's current position doesn't quite belong in a general-purpose function like pixel_vacant so perhaps doing the check in-instance and then supplying a "check_jumpthroughs" argument to pixel_vacant would be cleaner - this argument would be set to !place_meeting(x,y,parent_jumpthroughterrain) && (yspeed >= 0)


The drawback with this approach is that you need a player-sized berth around jumpthroughs and can't stack them directly on top of each other vertically, but since they usually have pretty thin hitboxes to begin with (only the top) it's not usually an issue.


Oh, and if you want to be able to fall through jumpthrough platforms, you need to check if you're standing on one and pressing down+jump, if true, move the player down enough pixels that they're now colliding with the jumpthrough (at least 2 to account for rounding errors when checking the pixel directly below the player for ground) and now they should ignore the jumpthrough they're currently standing on.