Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI ArmyPool being disbanded during games. #4411

Closed
relent0r opened this issue Nov 15, 2022 · 0 comments · Fixed by #4412
Closed

AI ArmyPool being disbanded during games. #4411

relent0r opened this issue Nov 15, 2022 · 0 comments · Fixed by #4412
Labels
area: AI related to AI functions

Comments

@relent0r
Copy link
Contributor

Describe the bug
The AI maintains a special platoon called the 'ArmyPool'. This is where all units go before they are pulled into platoons.
While doing some other work I realized that something was clearing the commands for all structures (extractors, factories etc) randomly. This happens during the PlatoonDisband function.
After troubleshooting I've found that something is disbanding the ArmyPool during games. I've done full logging and traced it to at least two places.

  1. The ACU thread,

    cdr.PlatoonHandle:PlatoonDisband()

  2. The ProcessBuildCommand function.

    ProcessBuildCommand = function(eng, removeLastBuild)

The ACU thread issue is relatively simple to fix. The ProcessBuildCommand one is a little harder as there are multiple things that call it including engineer callbacks. Which is where I think this problem may be coming from.

To Reproduce
Reproducing is easy as it will happen during AI games. It may not happen in EVERY game but I've noticed that its pretty consistent to happen at least once, and often multiple times over a game that spans 15+ minutes. But it required extensive logging to find the occurrences as the symptoms are not obvious.

Expected behavior
The ArmyPool should never be disbanded as this interrupts the AI's ability to create new platoons and clears the commands of any units in that ArmyPool.

Additional context
This issue has been relatively invisible as not many units have functionality that is interrupted. The most well known (by well know I mean noticed by 2 or 3 people) is that factories will randomly cancel building orders. Its not noticeable in the T1 stage because of the build speeds but when a T3 unit or support commander build is cancelled half way through it becomes more noticeable.

I'm currently looking at ways to resolve this issue. The most obvious solution is to make sure the platoon is checked within the PlatoonDisband function to make sure that it is not the army pool before it continues.

@relent0r relent0r added the status: new issue Is added to every issue to indicate that it has not been reviewed yet label Nov 15, 2022
@Garanas Garanas added area: AI related to AI functions and removed status: new issue Is added to every issue to indicate that it has not been reviewed yet labels Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: AI related to AI functions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants