Hand of Fate 2

Hand of Fate 2

Does fate favor you, Game Master?
Create and submit all-new encounters, challenges, equipment, traits, and more and shape your own adventures in the Game of Life and Death.
Learn More
Dubugging Info?
When the game crashes or hangs is there some info somewhere that gives some idea as to why?

I've currently got a situation where at the end of a combat the game sometimes freezes on the final strike and I can't figure out why.

The combat set up is:

Success Var: Combat Success
Scene Set SceneSet_Caves
Scene None (Scene) (greyed out)
Override Type: Nothing
Random Environment Sta (not checked)
Environment Faction: Mage
Change Caravan Env. On (not checked)
Choose Specific Environm (greyed out)
Quest Prefab: None (LevelProp)
Duration Time Limit
Timer Text
Magic Rod Charging
TIMER TEXT
Time Elapsed |NONE|
Auto Use Companion (checked)
Suppress Companion Voi (not checked)
Is Stair Combat (not checked)
Tutorial Hints (not checked)
Tutorial Dialogue None (UI Dialogue)
Objective Requirement Any
Defiant.Modding.CombatObjectiveTime
Success Var Time Success
Optional (not checked)
Mode (Failure On Elapsed)
Defiant.Modding.CombatObjectiveKillAll
Success Var Kill Success
Optional (not checked)

The context is:

Going into the encounter there will always be some enemy cards activated and the variable Time Limit will be a float with a value in the 15-200 range.

The combat node may be activated several times (with different enemies and time limits each time)

After the encounter there are two branches checking the condition "If $Combat Success == True/False" (one for each) that both immediately lead into a page (So I'm not falling afoul of an incorrectly specified junction)

The intended behaviour is:

If the player wins within the time limit they get rewards
If they fail then the enemy list is cleared, new enemies are added, the time limit is increased and they go again (repeating until they win or there are so many enemies that the player is killed, there is a check to prevent more than 4 cards of enemies being added)

The actual behaviour is:

If the player wins the first time they get rewarded
If they run out of time the first time they fight again.
If they win the second time they get rewarded.
If they run out of time the second time the game freezes.

Since the crash happens during the combat as opposed to in the dungeon afterwards I'm inclined to believe that the problem is within the combat encounter somehow, but I can't work out what might be causing it. Particularly what might be causing running out of time on the combat node to behave normally the first time, but crash the game on that exact same node the second time around.

I'm not really sure where to look for clues as to the probable cause.
< >
Showing 1-7 of 7 comments
x_equals_speed 1 15 Feb, 2018 @ 10:50am 
Coming back to this at a less 2am time I realise something that should've been obvious: The game didn't crash at all, Unity paused itself.

I've no idea why though, perhaps it thought it had got into an infinite loop when it hits the end battle sequence for the second time? I see that Unity has a "pause on error" option but it was unchecked.

Presumably that won't affect the mod in play though and I can just leave it as is.
shiva  [developer] 2 15 Feb, 2018 @ 2:28pm 
Certain errors (Asserts) will pause Unity. You should check the 'Console' window for any of these important messages (using the 'Collapse' option on the console window will help to hide all of those annoying shadow map 'errors'). If the assert message doesn't shed any light on things for you, please post about it here and include your editor.log (you can find that somewhere like: C:\Users\<username>\AppData\Local\Unity\Editor).
x_equals_speed 1 15 Feb, 2018 @ 3:49pm 
You're correct, it is indeed happening on an assert message. If I unpause Unity and continue it doesn't seem to have actually done any harm, but for all I know some value is NULL that will subsequently crash the game if interrogated later.

[ASSERT] on '<NULL>'
UnityEngine.Debug:LogError(Object, Object)
Defiant.Modding.DebugUtils:Assert(Boolean, GameObject, Object)
Defiant.Modding.DebugUtils:Assert(Boolean)
Defiant.Modding.CombatEncounter:ApplyCompleteContext(CompleteContext)
Defiant.Modding.CombatEncounter:Complete(CompleteContext)
Defiant.Modding.CombatEncounter:OnObjectiveComplete(CombatObjective, CompleteContext)
Defiant.Modding.CombatObjective:Complete(CompleteContext)
Defiant.Modding.CombatObjectiveKillAll:OnSpawnerComplete(AISpawner, GameObject, ICombatEffectContainer)
Defiant.Modding.AISpawner:Complete(GameObject, ICombatEffectContainer)
Defiant.Modding.AISpawnerSimple:OnAIDestroyed(Destroyable, ICombatEffectContainer)
Defiant.Modding.Destroyable:Die(ICombatEffectContainer)
Defiant.Modding.Destroyable:ApplyDamage(Damage, Boolean)
Defiant.Modding.CombatEffectDamage:Apply(ApplyContext)
Defiant.Modding.CombatEffect:Apply(ICombatEffectContainer, CombatTarget, Transform, Int32&, Int32&)
Defiant.Modding.CombatEffect:Apply(ICombatEffectContainer, CombatTarget, Transform)
Defiant.Modding.CombatProxy:ApplyEffects(CombatTarget, Transform)
Defiant.Modding.CombatProxyArea:UpdateAreaTarget(Targetable)
Defiant.Modding.CombatProxyArea:OnEnter(Targetable)
Defiant.Modding.CombatProxyArea:OnTriggerEnter(Collider)
x_equals_speed 1 15 Feb, 2018 @ 3:55pm 
The entry at the end of the log is:

Shadow map cache entry with NULL shadowmap?
UnityEditor.EditorGUIUtility:INTERNAL_CALL_RenderGameViewCamerasInternal(RenderTexture, Int32, Rect&, Vector2&, Boolean)
UnityEditor.EditorGUIUtility:RenderGameViewCamerasInternal(RenderTexture, Int32, Rect, Vector2, Boolean) (at C:\buildslave\unity\build\artifacts\generated\common\editor\EditorGUIUtilityBindings.gen.cs:642)
UnityEditor.GameView:OnGUI() (at C:\buildslave\unity\build\Editor\Mono\GameView\GameView.cs:747)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
System.Reflection.MethodBase:Invoke(Object, Object[]) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView:Invoke(String, Object) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:285)
UnityEditor.HostView:Invoke(String) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:278)
UnityEditor.HostView:InvokeOnGUI(Rect) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:245)
UnityEditor.DockArea:OldOnGUI() (at C:\buildslave\unity\build\Editor\Mono\GUI\DockArea.cs:383)
UnityEngine.Experimental.UIElements.IMGUIContainer:DoOnGUI(Event) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\IMGUIContainer.cs:127)
UnityEngine.Experimental.UIElements.IMGUIContainer:HandleEvent(EventBase) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\IMGUIContainer.cs:213)
UnityEngine.Experimental.UIElements.IMGUIContainer:DoRepaint(IStylePainter) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\IMGUIContainer.cs:50)
UnityEngine.Experimental.UIElements.Panel:PaintSubTree(Event, VisualElement, Matrix4x4, Rect) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\Panel.cs:447)
UnityEngine.Experimental.UIElements.Panel:PaintSubTree(Event, VisualElement, Matrix4x4, Rect) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\Panel.cs:457)
UnityEngine.Experimental.UIElements.Panel:Repaint(Event) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\Panel.cs:475)
UnityEngine.Experimental.UIElements.UIElementsUtility:DoDispatch(BaseVisualElementPanel) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\UIElementsUtility.cs:192)
UnityEngine.Experimental.UIElements.UIElementsUtility:ProcessEvent(Int32, IntPtr) (at C:\buildslave\unity\build\Runtime\UIElements\Managed\UIElementsUtility.cs:72)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:\buildslave\unity\build\Runtime\IMGUI\Managed\GUIUtility.cs:175)

Something is wrong with a shadow map? But it's the same combat in the same environment at the same time of day that I just did - it only throws an error on the second (and consecutive) instances.
shiva  [developer] 2 15 Feb, 2018 @ 4:28pm 
Ignore the shadow map stuff. They are a side effect of playing with built game bundles in Unity, unfortunately I can't suppress them.

The assert you're triggering is there to indicate that the combat encounter has already been marked complete by something else. Your scenario sounds similar to RaiderPrevention. You might try having a look at how it is setup versus yours. If you still can't figure it out, publish to the workshop privately and post your mod's steam id here and someone can take a look.
x_equals_speed 1 15 Feb, 2018 @ 4:49pm 
I am doing something similar to RaiderPrevention in that it's got a time limit and I care about how many of the enemies that were killed - I'm impressed you can tell that from those logs!

I don't understand all of it, it's got this feature I see quite a lot in the default encounters where the blackboard has actions which aren't start actions with no lines feeding in to them. How are those actions ever processed?

Where my encounter is different is that it's supposed to run several times. There's literally a loop that feeds back into the same combat node. So what's marking the combat encounter as complete is literally it being completed - that'd be why the error only occurs on the second and consecutive battles.

What variable does it set to mark the combat as complete? Presumably I could use a "set variable" action to undo it?

It's not practical to split the combat node into several combat nodes (one for each fight) because there can be arbitrarily many of them. After each fight the time limit increases and the number of enemies becomes double whatever survived the fight before. The fight repeats over and over until either the player manages to kill anything (scenario success) or doubling the survivors would result in too many enemies to put on the battlefield (scenario failure). In theory if a player killed exactly half of the enemies each time they could have infinity fights (In practice because the player gets more time each time you wouldn't expect that to happen - but if someone wants to use it as a means to get a lot of battles to farm good with the gladiators helm or some similar shenanigan then more power to them for exploiting the sceanrio)
x_equals_speed 1 15 Feb, 2018 @ 5:10pm 
I just figured how you got it from the logs, they show which combat objecives I care about.
< >
Showing 1-7 of 7 comments
Per page: 1530 50