Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Yal's SoulsVania Engine

Metroidvania / Soulslike project for GameMaker:Studio · By Yal

Odd enemy knight movement [Soulsvania Demo]

A topic by CrystarDev created Feb 01, 2022 Views: 123 Replies: 1
Viewing posts 1 to 2

Hi Yal !

I completed the demo and it was interesting but I noticed that the enemy knight throughout the game (especially near the end section) will go off-course and move diagonally upwards in areas it's not supposed to (as if it were walking on an invisible set of stairs). If I were to purchase the project file, may I ask please how to resolve this in the code so the knight moves regularly and on-course? It seems like an odd glitch / bug. I experienced this initially near the end section of the demo and I replayed the demo to re-affirm this.

Developer (1 edit)

I think the problem here is, the script that does collision checking for enemies only checks 6 points (the corners and the top/bottom center) for performance reasons so platforms that are a single tile tall can go through an enemy that tall without registering a collision, so the knight lands with their head on the first brick and then that counts as them being on the ground even though their feet are outside.

(The player checks more points and also has a smaller hitbox so this doesn't happen for them).

You could fix this by adding the additional checks (cross-check player_vacant and enemy_vacant scripts) to improve enemy collision checking precision, it was a mistake from my end to place the enemies near terrain they could get stuck on (the final area was kinda rushed).

(Here's a doodle to visualize what's happening)