Pathfinding and Timer Fixes, and Getting Salvage Working

Hey Folks! Hope everyone had a good weekend. Spent a lot of time with the fam this weekend, and had some nice outings and meals. It was a good break.

Back at the office, I tried to hit the code a bit harder today. And shirked a few of my PR duties in the process. "Get a derelict running again, 100% in-game" is feeling better and better as a foundation for everything else. So it's all about that right now.

As a result, today's work was largely fixing issues that arose from trying to uninstall and move a conduit with tools. And a lot of those were in the pathfinding and ticker system. Probably due to fixing bugs which had previously hidden/bypassed them after I updated the timers to be more accurate.

One of the issues was "pre-cooking" interactions. There are a few areas in the code where the object would finish something like walking or waiting, and the next interaction its queue was absorbing all of the accumulated time since the walking/waiting started. Part of this involved better cancellation code when the pathfinder was done walking. I also found a place where the object was checking range from the target differently than the pathfinder did, causing an endless pathfinding loop (and the crew walking in place).

Pathfinding had a bug when the target object and interaction had a range greater than zero. The tiles within that range were all supposed to be valid, but it was tripping on some walls, and then treating the object as unreachable. Plus, there was some code in the pathfinding per-frame movement code that incorrectly assumed open doors were impassable.

Some of those were pretty deep, important, but subtle fixes. One of those is a fix that still has a problem. So I'll be looking into those further tomorrow!

Tags: Ostranauts