
Advice on how to implement Tilemap vs Entity collisions
TL;DR: I just want to know how would you implement Tilemap collision detection and resolution and what algorithm would you use for a game with physics similar to Endoparasatic or, let's say, a simple version of Darkwood.
Hi. I'm trying to make a game kind of inspired on Endoparasatic and Darkwood (but a simpler version of it). I have a simple physics engine based on the SAT algorithm. It has been working on my game prototype, which is still very early, for entity vs entity collisions. However the last 2 weeks I've been working on my tilemap. I want to have "walls" in my map so entities should collide and slide on tiles.
So what I did was reusing this physics engine and include a collision shape to some of the tiles that need to have walls because I don't want the entire tile to be a wall, I just want a small portion of it to have a shape only for the wall section.
This worked mostly ok but the problem is entities only slide upwards until they touch the next tile. For example, I have one tile, the entity slide it perfectly fine. If I have a column of 2 tiles, it slides the first one but as soon as it touches the next one it stops because it collides in the vertical axis. This only happens when sliding upwards, the other directions are fine. I'm still analyzing what's the root cause of this.
So I basically want to solve this issue but I'm not sure if my approach (an array of tiles with collision shape data) is wrong so I wanted to get suggestions on what can I do to implement reliable tilemap collision detection. Please let me know what would you do based on your experience, thanks.