Skip to content

Extract Fix for 4.1.x#308

Open
dwesterwick wants to merge 2 commits intoSolarint:4.1.0from
dwesterwick:ExtractionFixForV4_2
Open

Extract Fix for 4.1.x#308
dwesterwick wants to merge 2 commits intoSolarint:4.1.0from
dwesterwick:ExtractionFixForV4_2

Conversation

@dwesterwick
Copy link
Contributor

Mostly fixes bot extraction that was broken again with one of the 4.1.x updates.

There is a strange race condition sometimes causing bots to be unable to path to their extraction points, and I can't figure out what's causing it. It looks like TriggerNewMove() initializes a new path for the bot, which clears CancelRequested. Immediately after this happens, CanProceedWithPath() returns false because CancelRequested is true, even though Cancel() didn't appear to run first. I have no idea what else might be setting CancelRequested to true. My only guess is that ClearCachedData() is running in parallel with TickPath(), but I'm not sure how the pathfinder is supposed to work. Here's an excerpt of what's happening:

[Warning:      SAIN] [SAIN.SAINComponent.Classes.Mover.BotPathDataManual] : [[Initialize().ClearCachedData()]:] : [ClearCachedData for Bot8]
[Warning:      SAIN] [SAIN.SAINComponent.Classes.Mover.BotPathDataManual] : [[TickPath().CanProceedWithPath()]:] : [Cancelled path for Bot8]
[Warning:      SAIN] [SAIN.SAINComponent.Classes.Mover.BotPathDataManual] : [[Stop().ClearCachedData()]:] : [ClearCachedData for Bot8]

Fortunately, 90% of bots seem to be extracting without issues, so maybe this isn't such a big deal.

@dwesterwick
Copy link
Contributor Author

I just updated this PR with a refactor for ExtractAction. It should now be tolerant of the race condition I described in the original PR summary.

Bots still randomly get stuck, but it's relatively uncommon. They also will now travel to the end of incomplete paths to extracts (which is expected to happen with Unity's limitations), wait ~10s, and then search for another extract. While this isn't ideal, it keeps them moving across the map to make raids more interesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant