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

PVE Game Freeze Which May Caused By AI Attacking Stealth Units Or Structures #17173

Closed
HansNilhall opened this issue Oct 4, 2019 · 5 comments · Fixed by #17205
Closed

PVE Game Freeze Which May Caused By AI Attacking Stealth Units Or Structures #17173

HansNilhall opened this issue Oct 4, 2019 · 5 comments · Fixed by #17205
Assignees
Labels

Comments

@HansNilhall
Copy link

HansNilhall commented Oct 4, 2019

Issue Summary

When AI tries to detect or attack some stealth units or structures, the game then might freeze and can only be closed by task manager. I have received several these kinds of reports from Chinese community and then try to test them out. Now as I myself have reproduced one of that circumstances which might cause bug, I believe it should be an issue.

In RA mod, there are two reports.

  1. At the moment when the reporter's Missile Sub was attacked by some AI infantries while the sub was trying submerging after firing missiles, the game froze.
  2. In Allies Mission 08b, after laying some mines by using Minelayers on the field, the game might freeze. (This is the circumstances I reproduced)

In SP mod, there are also two reports.

  1. The game froze when AI tried to attack the Nod stealth tank which is trying to stealth again after hit-and-run or the buildings which are protected by Nod stealth generator.
  2. When AI tried to attack CABAL's deployed Abductor or mines layed by CABAL's Artisan.

The second circumstance is the only one I can reproduce by myself because the others are reported by different Chinese players and I only experience others in multiplayer PVE while we were testing those two problems from SP. And we are using different OS.

System Information

I will use some special marks to show or explain clearly in the section of System Information
bolded texts - means my situation while reproducing the bug;
italic text - means other testers and me while experience the bug in SP;
'...' - means the reporter's OS of the first circumstance of RA.

  • Operating System: Win10, 'Win7 64x', Win10 Win7
  • .NET / Mono Version: .NET 4.8, 'Unknown', .NET 4.8 .NET 4.7
  • OpenRA Version: playtest-20190825, 'release-20190314, SP release-20190623
  • Mod: Red Alert, 'Red Alert', Shattered Paradise

Additional Information:

- Steps to reproduce
1. Allies Mission 08b
2. Clear the road to the base
3. Use the minelayers to set mines on the way which enemies must come from
4. Wait or play normally until the game freeze
PS: FiveAces had reported the same thing on discord channel on 26th, Aug 2019.

- Logs
There is no useful log

- OpenRA Replays
Allies 08b - playtest-20190825.zip

- Screenshots & Videos

The sceenshot below was given by the reporters who reports the submarine freeze.
The cursor shows the game was freeze at that moment and in the red circle, an AI rifle man was trying to attack player's missile sub.
QQ截图20191005021013

The screenshot below was the moment when the game freeze while playing Allies Mission 08b.
The white fog-like thing is the special effect of the app having no respond in Win10.
This one was captured by myself.
QQ图片20191005020618

@pchote pchote added this to the Next Release milestone Oct 4, 2019
@abcdefg30 abcdefg30 added the Bug label Oct 4, 2019
@pchote
Copy link
Member

pchote commented Oct 4, 2019

Reproduced the freeze in allies-08b and used the debugger to break out and see that this is caused by the lua script calling Actor.QueueActivity which then gets in an endless loop of queuing CallLuaFunc and ReturnToBase within the same tick (with the list continuing to grow without bound when resuming / rebreaking)

Screenshot 2019-10-05 at 00 05 18

@pchote
Copy link
Member

pchote commented Oct 4, 2019

Possibly related to:

IMO this is getting pretty hacky. The real issue is that ReturnToBase cancels the whole queue, which is against our own guidelines for how activities should behave.

The proper solution is to remove the activity cancelling from ReturnToBase entirely and let FlyAttack be solely responsible for breaking out of a potential infinite loop. This can be done by checking whether the branch of FlyAttack.Tick that calls ReturnToBase is entered two ticks in a row and going to NextActivity if that is the case.

Originally posted by @tovl in #17030 (comment)

@tovl
Copy link
Contributor

tovl commented Oct 6, 2019

The relevant part of the Lua script:

TargetAndAttack = function(mig, target)
if not target or target.IsDead or (not target.IsInWorld) then
local enemies = Utils.Where(greece.GetActors(), function(actor)
return actor.HasProperty("Health") and actor.Type ~= "brik"
end)
if #enemies > 0 then
target = Utils.Random(enemies)
end
end
if target and mig.AmmoCount() > 0 and mig.CanTarget(target) then
mig.Attack(target)
else
mig.ReturnToBase()
end
mig.CallFunc(function()
TargetAndAttack(mig, target)
end)
end

@pchote
Copy link
Member

pchote commented Oct 9, 2019

That will certainly do it...

There is a good chance that the issue with submarines / SP units has already been fixed by the activity rework, so the best approach here will be to fix the script issue then consider this solved.

@abcdefg30
Copy link
Member

Yes, I couldn't reproduce a freeze in any AI games outside of the missions. So I consider this fixed with #17205 unless we get another reproduction case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants