View Issue Details

IDProjectCategoryLast Update
0019518AI War 2Crash/ExceptionMar 21, 2018 1:43 pm
ReporterBadgerBadger Assigned ToChris_McElligottPark  
Status resolvedResolutionfixed 
Product Version0.714 
Fixed in Version0.715 
Summary0019518: Nasty crash during voice effect
DescriptionI had just reloaded a save game. An AI force appeared to attack one of my planets and I hit this crash:

Error in thread for execution context 'executionContext'
UnityException
StartCoroutine_Auto_Internal can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
===STACK FRAMES (with file info)===
FILE METHOD IL_OFFSET NATIVE_OFFSET LINE_NUMBER COLUMN_NUMBER
/home/builduser/buildslave/unity/build/artifacts/generated/common/runtime/MonoBehaviourBindings.gen.cs StartCoroutine 3 30 62 0
        PlayVoiceAtCameraWithDelay 0 154 0 0
        PlayVoiceAtCameraWithDelay 0 87 0 0
        PlaySoundByType 0 170 0 0
        TakeDamage 0 3005 0 0
        DoHitLogic 0 893 0 0
        DoHitLogic 0 88 0 0
        DoEntityStepLogic_Shot 0 2047 0 0
        <DoCombatStep>b__99_3 0 43 0 0
        DoForEntities 0 259 0 0
        DoForEntities 0 139 0 0
        DoCombatStep 0 1543 0 0
        DoWorldStepLogic 0 1725 0 0
        Execute 0 339 0 0
===RAW STACK TRACE===
  at (wrapper managed-to-native) UnityEngine.MonoBehaviour:StartCoroutine_Auto_Internal (System.Collections.IEnumerator)
  at UnityEngine.MonoBehaviour.StartCoroutine (IEnumerator routine) [0x00003] in /home/builduser/buildslave/unity/build/artifacts/generated/common/runtime/MonoBehaviourBindings.gen.cs:62
  at Arcen.AIW2.ExternalVisualization.BattlefieldVisualSingleton.PlayVoiceAtCameraWithDelay (Arcen.Universal.ArcenSFXItemBase SoundClip, Single Delay) [0x00000] in <filename unknown>:0
  at PresentationLayer_AIW2.PlayVoiceAtCameraWithDelay (Arcen.Universal.ArcenSFXItemBase SoundClip, Single Delay) [0x00000] in <filename unknown>:0
  at PresentationLayer_AIW2.PlaySoundByType (SFXItemType_NonPositional Type) [0x00000] in <filename unknown>:0
  at Arcen.AIW2.Core.GameEntity.TakeDamage (Int32 Damage, Arcen.AIW2.Core.EntitySystem FiringSystemOrNull, Arcen.AIW2.Core.GameEntity ShotThatHitOrNull, Boolean IsSelfDamage, Boolean HonorFiniteHitCountAOE, System.Int32& ActualDamageDone, Arcen\
.AIW2.Core.ArcenSimContext Context) [0x00000] in <filename unknown>:0
  at Arcen.AIW2.Core.GameEntity.DoHitLogic (Arcen.AIW2.Core.GameEntity Target, Boolean HonorFiniteHitCountAOE, FInt PercentOfTotalAttackPowerForThisHit, Arcen.Universal.FInt& PercentOfTotalAttackPowerUsedForThisHit, Arcen.AIW2.Core.ArcenSimCont\
ext Context) [0x00000] in <filename unknown>:0
  at Arcen.AIW2.Core.GameEntity.DoHitLogic (Arcen.AIW2.Core.GameEntity Target, Arcen.AIW2.Core.ArcenSimContext Context) [0x00000] in <filename unknown>:0
  at Arcen.AIW2.Core.GameEntity.DoEntityStepLogic_Shot (Arcen.AIW2.Core.ArcenSimContext Context) [0x00000] in <filename unknown>:0
  at Arcen.AIW2.Core.Planet+<>c.<DoCombatStep>b__99_3 (Arcen.AIW2.Core.GameEntity entity) [0x00000] in <filename unknown>:0
  at Arcen.AIW2.Core.EntityCollection.DoForEntities (GameEntityCategorySet Set, Arcen.AIW2.Core.ProcessorDelegate Processor) [0x00000] in <filename unknown>:0
  at Arcen.AIW2.Core.Planet.DoForEntities (GameEntityCategorySet Set, Arcen.AIW2.Core.ProcessorDelegate Processor) [0x00000] in <filename unknown>:0
  at Arcen.AIW2.Core.Planet.DoCombatStep (Arcen.AIW2.Core.ArcenSimContext Context) [0x00000] in <filename unknown>:0
  at Arcen.AIW2.Core.World_AIW2.DoWorldStepLogic (Arcen.AIW2.Core.ArcenSimContext Context) [0x00000] in <filename unknown>:0
  at Arcen.AIW2.Core.SimExecution.Execute () [0x00000] in <filename unknown>:0
                                                                                                                                                                                                                                                     
   at System.Environment.get_StackTrace() in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Environment.cs:line 227
   at Arcen.Universal.ArcenDebugging.ArcenDebugLog(System.String Message, DebugLogDestination Destination, Boolean IncludeStackTrace, Verbosity Verbosity)
   at Arcen.Universal.ArcenDebugging.ArcenDebugLog(System.String Message, DebugLogDestination Destination, Verbosity Verbosity)
   at Arcen.Universal.ArcenDebugging.ArcenDebugLog(System.String Message, Verbosity Verbosity)
   at Arcen.Universal.ArcenDebugging.LogException(System.Exception e, System.String message, Verbosity verbosity)
   at Arcen.AIW2.Core.SimExecution.Execute()
   at Arcen.AIW2.Core.ArcenSimPlanningContext.InnerRun()
   at Arcen.AIW2.Core.ArcenExecutionContext.InnerRun()

The function in question is
        public void PlayVoiceAtCameraWithDelay( ArcenSFXItemBase SoundClip, float Delay )
        {
            if ( !GameSettings.Current.GetBool( ArcenBoolSetting_Universal.EnableVoice ) )
                return;
            ArcenVisualOrganizer.Instance.StartCoroutine( PlayVoiceAtCameraWithDelay_Internal( SoundClip, Delay ) );
        }

                                                                                                                                                                                   
TagsNo tags attached.

Relationships

has duplicate 0019516 resolvedChris_McElligottPark Some units became unresponsive after wave sent 

Activities

Chris_McElligottPark

Mar 21, 2018 11:26 am

administrator   ~0047256

* Fixed a crash if your Ark got shot or you lost a planet.
** The AI was being REALLY thorough, apparently.
** More seriously, it was a bug in how we were delaying the voice report of this activity. Coroutines are not thread-safe, and we were mistakenly using them from a non-main thread.

Issue History

Date Modified Username Field Change
Mar 21, 2018 10:48 am BadgerBadger New Issue
Mar 21, 2018 10:48 am BadgerBadger Status new => assigned
Mar 21, 2018 10:48 am BadgerBadger Assigned To => Chris_McElligottPark
Mar 21, 2018 11:11 am BadgerBadger Description Updated
Mar 21, 2018 11:26 am Chris_McElligottPark Status assigned => resolved
Mar 21, 2018 11:26 am Chris_McElligottPark Resolution open => fixed
Mar 21, 2018 11:26 am Chris_McElligottPark Fixed in Version => 0.715
Mar 21, 2018 11:26 am Chris_McElligottPark Note Added: 0047256
Mar 21, 2018 1:43 pm BadgerBadger Relationship added has duplicate 0019516