Guilherme De Sousa wrote:
The actual problem is that the view is initially blank.
Rotating you can see 2 wall sections.
Probably a camera/FOV vector initialization problem somewhere.
Moving forward reveals more walls some of which appear to be
only half their width, others seem to flick in and out of view.
The walls that do appear don’t really seem to match the map.
Some screenshots and the actual map used would help, but also see below.
What I thought I might do was create a very small, simple map
of my own as it might be easier to step through things that way.
You should absolutely do that, especially since you are working with
No but I was hoping somebody might be able to tell me that the
approach (checking each quadrant) is ok or maybe see that I’m making
a false assumption.
The approach you have chosen may not work very well. It will make all your
walls paper-thick, which depending on your exact map layouts may or may
not work. With the algorithm presented, you will need to make many tweaks in
order to give your walls some thickness. In fact, I think it will be so many
tweaks it will kill the intended performance.
Instead, I think you should convert your game map to the format used by the
algorithm, where each square has the exact size of your wall thickness. So
one game square (as in your screenshot) becomes many engine squares, not
just 1. And by also adding your approach to this, you can give each wall
section (engine square) a different texture on each side.
It’s also worth mentioning that the raycasting tutorial in question is
incomplete for your purposes. It has no partially obscuring sections
handling (like an open door or that arch in your AR screenshot).
Also, can you walk freely in this game or is the movement purely room by
room with orthogonal-only turning? You may not even need the raycasting
technique if it’s the latter. You could also generate the map for the
algorithm dynamically, depending on what room you are in to keep it small.