Page 1 of 1

Dynamic NPC Collisions (Tile-based map)

Posted: Sat Nov 05, 2016 4:36 pm
by Valentio
Hi everybody! I'm developing a game of pokemon in love2d, and i'm blocked with the issue of dynamic NPC/Player collisions. I made a two-dimensional array of collisions in order to the player couldn't go through of NPC's. This runs, but only in NPC-static cases. The bug of NPC-dynamic collision usually evolve to character movement error. I called them the bug outside the grid (the character stops moving correctly in tiles).

I think the mistake is not to consider the real time, there are many possibilities of dynamic collision between NPC and player.
I think that there is an specific algorythm that makes the dynamic collision correctly. I need help. Thanks :)

PD: Sorry for my bad English

Re: Dynamic NPC Collisions (Tile-based map)

Posted: Sun Nov 06, 2016 9:11 am
by deströyer
Check out Axis Aligned Bounding Box collisions (eg. https://www.youtube.com/watch?v=ghqD3e37R7E ) - your player and NPCs will probably be square-ish, and this is one of the simplest and cheapest collision checks you can run in terms of processing power.