Here's how the vision algorithm works. All examples are illustrated using a vision range of 2.
Step1 : Get all tiles within the vision range distance
All tiles within a range distance of 2 are highlighted in yellow
Step2 : For each tile retrieved in step1, retrieve all objects attached to the tile anchors
Step3 : For each tile retrieved in step1 and for each objects retrieved in step2, use 3D raycasts to determine if they are visible or not.
Raycasting to all potential tile and object candidates
Each detected tiles and objects highlighted in yellow
This vision system isn't very sophisticated nor efficient, but it's working well for the challenge context. There are interesting edge cases to keep in mind, like this one :
Example of a wall not detected because of a nearby wall detected first