Creature Sprites vs. Map Position

Hey Folks! Back on the NEO Scavenger port today. And it was a bit of a slow day, as I'm still stuck on maps.

Today's image pretty succinctly shows the problem: when the game changes resolution, creatures get offset from where they should be. The camera for the map is changing scroll values during resolution swap, and I have code to redraw the creatures based on their current tile position. However, it seems that might not be happening in the right order.

The weird thing is, I can't seem to find any place in the code where this works. Except one: if I make the creature position update happen based on a hotkey, it works.

I'm suspicious this might be due to the way the camera scrolling works. It's possible that all the calculations to the camera scroll rectangle are happening when the game changes resolutions, but that the actual camera scroll value only updates during the frame update. Put another way, the game has to update one frame before I set creature positions.

I think.

Tomorrow, maybe I can test this with a script delay or some sort of listener. Set a flag somewhere that creatures need fixing when the resolution changes, but don't act upon it until one frame later?

In better news, I was at least able to get the map scrolling boundaries working in all resolutions, and when changing resolutions. I had to make some new UI settings for each resolution to control how close to the screen edge maps should get, and use that to set camera scroll bounds. I still get a bit of deadzone at the edges when WASD scrolling, but it's a minor issue that I can wait on fixing.

I also found a typo in the code that continually updated the player's hex instead of each creature when updating visibility on the map. And I think I found and fixed a null sprite error in software items.

So not a bad day, necessarily. Just really annoyed at the persistence of this creature sprite bug!