Is there built-in support for things like collision-detection, area-entry etc, for grid-based games?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By cammil

As I understand it, collision detection and area entry detection is done at the floating point level, and with pixel based games, at the pixel level. How would one achieve collision detection and area entry with a grid based game?

I am calling a grid-based game one where there are a small set of possible locations any entity can be in. Think of most board games, chess for example. A piece cannot move into a square where there is another piece of the same color.

I feel like these kinds of games are common enough that there might be a recommended way to achieve that behaviour. Is there?

NB: Chess is only a simple example, and you could probably do that easily with some custom code. But I am thinking of much more complex games with say 100s of moving, automated entities.

Additional info: been working with Godot only for a few days, all in 3D.

So you want to detect if object in specific cell in grid space? How do you want to represent your object? Only in grid space? Do objects occupy more than one grid cell? Can object detect collision only if it is on a grid cell position and not while it is moving beetwin two cell positions?

pospathos | 2019-04-11 00:15

See this post.

pospathos | 2019-04-11 13:17