This is fun.
I would be surprised if binary space partitions aren’t involved.
Try the game The Stanley Parable it actually resembles more that game than Portal