Hello there! You are correct, that is game logic basically. Those walls are there to prevent players from getting lost inside dark corridors and getting stuck.