It was a frustrating weekend filled with regressions and complex problems to solve…
The travel module is by far the oldest code in the game. Iterations of it go back all the way to 2005. As a result, some things that DID work long ago weren’t working now.
Boats, for example, were completely broken. At some point I completely removed my original code, so I had to re-write it from scratch.
A big part of that was that I decided not to have your boat “carried” by moving water. The main issue is that it breaks the turn-based nature of the rest of the game, and it also requires checking for moving water tiles on an interrupt.
Light was another broken part, I found every single cave I went into was fully lit. I investigated and discovered I had never re-integrated light properly after changing the LOS algorithm. This lead to a two-day maddening exercise where a few simple code changes BROKE the LOS algorithm and I had to chase down why.
But the worst thing this weekend was slants and wraps.
I designed the map engine to allow me to project maps not only in squares or rectangles, but also as rhomboids, a slanted rectangle. This means making sure that when both you and mobs move, they move with correction to the X axis in relation to the Y to account for the slant. It also affects placement of mobs in the map window. The short explanation here is, you NEED your Y differential because you need to calculate what actual window thresholds are per line. It took a lot of experimentation and code cycling to get this right.
The other thing maps can do is wrap. Normal map mode just extends the last character on the edges to infinity; stepping off the map forces a reload to a new map. Wrapped mode means it projects to the other edge, and creates a closed loop. Projecting the map isn’t too bad, but mob placement once again gets complex; you have to account for the fact that a mob and you could be at opposite ends and thus extremely close, not far away.
On the plus side, transactions are working well. I got the gambling module working great, and buying and selling works too.
Next on the list, I have to fix up some other services (healing, identifying) and make sure the new inventory system (removing and using equipment and items) works as intended.