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

Fix Crash when Mcv: UnitsCommonName is not set #14205

Merged
merged 1 commit into from Dec 28, 2017

Conversation

Projects
None yet
5 participants
@MustaphaTR
Member

MustaphaTR commented Oct 17, 2017

My mod has no MCVs, AI was crashing when it has War Factory but no Command Center.

@MustaphaTR

This comment has been minimized.

Show comment
Hide comment
@MustaphaTR

MustaphaTR Oct 19, 2017

Member

Updated, also crash log:

OpenRA engine version gen-20171010_2
Generals Alpha mod version gen-20171017
on map a1c806cbd31f9e45bcbb89b6b1c5ebeb75ec763b (Not TEST by MustaphaTR).
Date: 2017-10-19 16:38:04Z
Operating System: Windows (Microsoft Windows NT 6.1.7601 Service Pack 1)
Runtime Version: .NET CLR 4.0.30319.42000
Exception of type `System.ArgumentException`: Collection must not be empty.
Parametre adı: ts
   konum: OpenRA.Exts.Random[T](IEnumerable`1 ts, MersenneTwister r, Boolean throws) h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\Exts.cs içinde: satır 157
   konum: OpenRA.Exts.Random[T](IEnumerable`1 ts, MersenneTwister r) h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\Exts.cs içinde: satır 142
   konum: OpenRA.Mods.Common.AI.HackyAI.GetInfoByCommonName(HashSet`1 names, Player owner) h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Mods.Common\AI\HackyAI.cs içinde: satır 540
   konum: OpenRA.Mods.Common.AI.HackyAI.ProductionUnits(Actor self) h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Mods.Common\AI\HackyAI.cs içinde: satır 1311
   konum: OpenRA.Mods.Common.AI.HackyAI.Tick(Actor self) h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Mods.Common\AI\HackyAI.cs içinde: satır 740
   konum: OpenRA.World.<Tick>b__a(TraitPair`1 x) h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\World.cs içinde: satır 347
   konum: OpenRA.WorldUtils.DoTimed[T](IEnumerable`1 e, Action`1 a, String text) h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\WorldUtils.cs içinde: satır 75
   konum: OpenRA.World.Tick() h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\World.cs içinde: satır 0
   konum: OpenRA.Game.InnerLogicTick(OrderManager orderManager) h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\Game.cs içinde: satır 604
   konum: OpenRA.Game.LogicTick() h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\Game.cs içinde: satır 628
   konum: OpenRA.Game.Loop() h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\Game.cs içinde: satır 755
   konum: OpenRA.Game.Run() h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\Game.cs içinde: satır 795
   konum: OpenRA.Program.Run(String[] args) h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\Support\Program.cs içinde: satır 136
   konum: OpenRA.Program.Main(String[] args) h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\Support\Program.cs içinde: satır 40
Member

MustaphaTR commented Oct 19, 2017

Updated, also crash log:

OpenRA engine version gen-20171010_2
Generals Alpha mod version gen-20171017
on map a1c806cbd31f9e45bcbb89b6b1c5ebeb75ec763b (Not TEST by MustaphaTR).
Date: 2017-10-19 16:38:04Z
Operating System: Windows (Microsoft Windows NT 6.1.7601 Service Pack 1)
Runtime Version: .NET CLR 4.0.30319.42000
Exception of type `System.ArgumentException`: Collection must not be empty.
Parametre adı: ts
   konum: OpenRA.Exts.Random[T](IEnumerable`1 ts, MersenneTwister r, Boolean throws) h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\Exts.cs içinde: satır 157
   konum: OpenRA.Exts.Random[T](IEnumerable`1 ts, MersenneTwister r) h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\Exts.cs içinde: satır 142
   konum: OpenRA.Mods.Common.AI.HackyAI.GetInfoByCommonName(HashSet`1 names, Player owner) h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Mods.Common\AI\HackyAI.cs içinde: satır 540
   konum: OpenRA.Mods.Common.AI.HackyAI.ProductionUnits(Actor self) h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Mods.Common\AI\HackyAI.cs içinde: satır 1311
   konum: OpenRA.Mods.Common.AI.HackyAI.Tick(Actor self) h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Mods.Common\AI\HackyAI.cs içinde: satır 740
   konum: OpenRA.World.<Tick>b__a(TraitPair`1 x) h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\World.cs içinde: satır 347
   konum: OpenRA.WorldUtils.DoTimed[T](IEnumerable`1 e, Action`1 a, String text) h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\WorldUtils.cs içinde: satır 75
   konum: OpenRA.World.Tick() h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\World.cs içinde: satır 0
   konum: OpenRA.Game.InnerLogicTick(OrderManager orderManager) h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\Game.cs içinde: satır 604
   konum: OpenRA.Game.LogicTick() h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\Game.cs içinde: satır 628
   konum: OpenRA.Game.Loop() h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\Game.cs içinde: satır 755
   konum: OpenRA.Game.Run() h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\Game.cs içinde: satır 795
   konum: OpenRA.Program.Run(String[] args) h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\Support\Program.cs içinde: satır 136
   konum: OpenRA.Program.Main(String[] args) h:\OpenRA\Generals Alpha\generals-alpha-engine\OpenRA.Game\Support\Program.cs içinde: satır 40
@penev92

This comment has been minimized.

Show comment
Hide comment
@penev92

penev92 Nov 21, 2017

Member

I looked over the stack trace and the code, but I still fail to see how it could crash. Can you provide a test case in one of the official mods?

Member

penev92 commented Nov 21, 2017

I looked over the stack trace and the code, but I still fail to see how it could crash. Can you provide a test case in one of the official mods?

@MustaphaTR

This comment has been minimized.

Show comment
Hide comment
@MustaphaTR

MustaphaTR Nov 21, 2017

Member

Here is crash reproduced on lastest release:

OpenRA engine version release-20171014
Red Alert mod version release-20171014
on map be886cea6e0057100a637522e732425bc7ae7ad5 (Duel Area - Unmodded by Mustafa Alperen SEKİ).
Date: 2017-11-21 16:38:03Z
Operating System: Windows (Microsoft Windows NT 6.1.7601 Service Pack 1)
Runtime Version: .NET CLR 4.0.30319.42000
Exception of type `System.ArgumentException`: Collection must not be empty.
Parametre adı: ts
   konum: OpenRA.Exts.Random[T](IEnumerable`1 ts, MersenneTwister r, Boolean throws)
   konum: OpenRA.Exts.Random[T](IEnumerable`1 ts, MersenneTwister r)
   konum: OpenRA.Mods.Common.AI.HackyAI.GetInfoByCommonName(HashSet`1 names, Player owner)
   konum: OpenRA.Mods.Common.AI.HackyAI.ProductionUnits(Actor self)
   konum: OpenRA.Mods.Common.AI.HackyAI.Tick(Actor self)
   konum: OpenRA.World.<Tick>m__3(TraitPair`1 x)
   konum: OpenRA.WorldUtils.DoTimed[T](IEnumerable`1 e, Action`1 a, String text)
   konum: OpenRA.World.Tick()
   konum: OpenRA.Game.InnerLogicTick(OrderManager orderManager)
   konum: OpenRA.Game.LogicTick()
   konum: OpenRA.Game.Loop()
   konum: OpenRA.Game.Run()
   konum: OpenRA.Program.Run(String[] args)
   konum: OpenRA.Program.Main(String[] args)

Remove MCV: from ai.yaml (not whole UnitsCommonNames, it is required.) and Replace BaseActor of MPStartUnits@mcvonly: with Construction Yard (AI doesn't deploy MCV otherwise). Let AI build War Factory and kill its construction yard.

Member

MustaphaTR commented Nov 21, 2017

Here is crash reproduced on lastest release:

OpenRA engine version release-20171014
Red Alert mod version release-20171014
on map be886cea6e0057100a637522e732425bc7ae7ad5 (Duel Area - Unmodded by Mustafa Alperen SEKİ).
Date: 2017-11-21 16:38:03Z
Operating System: Windows (Microsoft Windows NT 6.1.7601 Service Pack 1)
Runtime Version: .NET CLR 4.0.30319.42000
Exception of type `System.ArgumentException`: Collection must not be empty.
Parametre adı: ts
   konum: OpenRA.Exts.Random[T](IEnumerable`1 ts, MersenneTwister r, Boolean throws)
   konum: OpenRA.Exts.Random[T](IEnumerable`1 ts, MersenneTwister r)
   konum: OpenRA.Mods.Common.AI.HackyAI.GetInfoByCommonName(HashSet`1 names, Player owner)
   konum: OpenRA.Mods.Common.AI.HackyAI.ProductionUnits(Actor self)
   konum: OpenRA.Mods.Common.AI.HackyAI.Tick(Actor self)
   konum: OpenRA.World.<Tick>m__3(TraitPair`1 x)
   konum: OpenRA.WorldUtils.DoTimed[T](IEnumerable`1 e, Action`1 a, String text)
   konum: OpenRA.World.Tick()
   konum: OpenRA.Game.InnerLogicTick(OrderManager orderManager)
   konum: OpenRA.Game.LogicTick()
   konum: OpenRA.Game.Loop()
   konum: OpenRA.Game.Run()
   konum: OpenRA.Program.Run(String[] args)
   konum: OpenRA.Program.Main(String[] args)

Remove MCV: from ai.yaml (not whole UnitsCommonNames, it is required.) and Replace BaseActor of MPStartUnits@mcvonly: with Construction Yard (AI doesn't deploy MCV otherwise). Let AI build War Factory and kill its construction yard.

@pchote

pchote approved these changes Dec 28, 2017

@pchote pchote merged commit 841c873 into OpenRA:bleed Dec 28, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@MustaphaTR MustaphaTR deleted the MustaphaTR:fix-ai-no-mcv-crash branch Dec 28, 2017

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