YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
21 stars 8 forks source link

Custom Collider Per Tile #2701

Open BiLLz-BiZiLLiAMz opened 8 months ago

BiLLz-BiZiLLiAMz commented 8 months ago

Is your feature request related to a problem?

Not related to an issue, just a suggestion to improve a current feature.

Describe the solution you'd like

I love how the collision functions now work with tile maps. I would love it if it could be taken one step further to the point where a custom collider could be selected for each tile instead of just defaulting to a precise collider for each tile.

Describe alternatives you've considered

I have considered making tilesets for collisions and tilesets for decorations, but custom colliders per tile will help streamline the process.

Additional context

No response

KormexGit commented 8 months ago

I've been duplicating my tile layer and then changing the tileset to one with the collisions I want, which can be a bit tedious (and easy to forget to do it when making edits and then have messed up collision). Would definitely love a way to have it use the collision mask I want from the start instead of needing to duplicate and manually assign the collision tileset. The reason I do this is because my main tileset has bumpy edges, which leads to move_and_collide's slope collision getting stuck on the bumps. I swap out the bumpy tileset for one with the same tiles but smooth edges, set it's visibility to false, and then use that for collision.

jackerley commented 8 months ago

I'm not entirely sure what you are asking for here? Could you explain more clearly?

KormexGit commented 8 months ago

For me at least I imagine it as something like a mask_index for a tileset, so you can do both collision and visuals for a tilemap with just a single layer. Right now you need separate collision and visual layers if your tileset sprite's shape isn't the precise shape you want for collision. Imagine for example you have a sloped tile with a grass texture on it. You probably don't want your slope's collision to actually have a bumpy textured edge, since that messes with moving up and down the slope smoothly. You'd instead want to use a different collision mask with a smooth slope. Currently this requires two separate layers, which then have to be updated separately each time you make edits to the level. So if you could tell a tilemap to use one sprite for visuals and then a different sprite with the same layout for collision, it'd smooth out the workflow. This is only relevant for the precise collision type, for rectangle it wouldn't make a difference.