Isometric Grid Coordinates
Master 2.5D projection matrices and inverse screen-space mappings.
How does it work? ↓Projecting 2D Arrays into 2.5D Space
Creating an "Isometric" game like Hades or classic RollerCoaster Tycoon doesn't actually require a 3D engine. It is entirely an illusion generated by mathematical projection.
An Isometric tilemap is just a standard 2D `int[][]` array. When rendering the level, we apply a mathematical formula to skew the X and Y coordinates. The industry standard is mapping the `X Axis` diagonally down-and-right, and the `Y Axis` diagonally down-and-left. Because pixels are squarish, a true isometric projection (30 degree angles) is virtually impossible to draw cleanly on an LCD without severe aliasing. Thus, the gaming industry universally adopted the 2:1 pixel ratio (where a tile is exactly twice as wide as it is tall) because it allows for perfectly clean stair-stepping pixel art.
Screen to Isometric Inverse Mapping
Rendering an isometric grid is easy, but discovering exactly which tile the player's physical mouse is clicking on is notoriously difficult mathematics. To solve this, we cannot use colliders. We must take the raw Screen `(X, Y)` coordinate of the mouse and feed it into an Inverse Matrix. This formula mathematically reverse-engineers the projection and returns the exact integer `(Column, Row)` index of the array that was clicked on.