Pathway

Pathway

View Stats:
Man of God 14 Aug, 2023 @ 12:15am
Crash after using Dash skill through an Ambush covered area
I was playing on the final fight against the Nazis on Adventure 2 (Wrath of God).

I used Dash to move my character outside of an enemy ambush covered zone. The game crashed as soon as my character landed in the square I selected to dash to (which was outside of the ambush zone).

Specifically I asked him to dash over an obstacle and 2 spaces to the right (outside of an ambush zone) and the game crashed.

Here's the stacktrace:

**************************************** Game: **************************************** Version: 1.4.1 command line arguments: --steam monitor: [0] Dell AW3423DW(DisplayPort) 3440x1440 (primary) 640x480 (60, 100, 120, 144, 175 hz) 720x480 (60, 100, 120, 144, 175 hz) 720x576 (60, 100, 120, 144, 175 hz) 800x600 (60, 100, 120, 144, 175 hz) 1024x768 (60, 100, 120, 144, 175 hz) 1280x720 (60, 100, 120, 144, 175 hz) 1280x768 (60, 100, 120, 144, 175 hz) 1152x864 (60, 100, 120, 144, 175 hz) 1280x800 (60, 100, 120, 144, 175 hz) 1360x768 (60, 100, 120, 144, 175 hz) 1366x768 (60, 100, 120, 144, 175 hz) 1280x960 (60, 100, 120, 144, 175 hz) 1280x1024 (60, 100, 120, 144, 175 hz) 1600x900 (60, 100, 120, 144, 175 hz) 1440x1080 (60, 100, 120, 144, 175 hz) 1600x1024 (60, 100, 120, 144, 175 hz) 1680x1050 (60, 100, 120, 144, 175 hz) 1600x1200 (60, 100, 120, 144, 175 hz) 1920x1080 (60, 100, 120, 144, 175 hz) 1920x1200 (60, 100, 120, 144, 175 hz) 1920x1440 (60, 100, 120, 144, 175 hz) 2560x1440 (60, 100, 120, 144, 175 hz) 3440x1440 (60, 100, 120, 144, 175 hz) 4587x1920 (60, 100, 120, 144, 175 hz) 5160x2160 (60, 100, 120, 144, 175 hz) selected video mode: 3440x1440 (144 hz, fullscreen) on monitor '[0] Dell AW3423DW(DisplayPort) 3440x1440' OpenGL: NVIDIA GeForce RTX 4090/PCIe/SSE2 (3.2.0 NVIDIA 536.99) - test GL_RG32F support ... ok! **************************************** System: **************************************** OS: Windows 10 amd64, version 10.0 number of processors: 16 Java VM: OpenJDK 64-Bit Server VM VM arguments: -Xmx4G **************************************** Log: **************************************** ... Game - Changed from AttackNode to InActionNode Game - Hitchance 100 Game - DMG: -0 AR, -48 HP, CRIT: false Game - GameStat NaziKills adjusted by 1. New amount: 98 Game - GameStat DisintegratorKills adjusted by 1. New amount: 35 Game - GameStat SingleShotKills adjusted by 1. New amount: 55 Game - SequenceCommand with size 0 executed, are you sure about this? Game - Changed from InActionNode to NormalSelectedNode Game - New active ControllerUILayer: EncounterTileMovement (Stack size: 1) Game - Trying to show deferred tutorials: 2 Game - Showing tutorial: CombatActionBar Game - Showing tutorial: CombatTabView Game - New active ControllerUILayer: Encounter (Stack size: 1) Game - Changed from NormalSelectedNode to NormalSelectedNode Game - New active ControllerUILayer: EncounterTileMovement (Stack size: 1) Game - Trying to show deferred tutorials: 0 Game - Marker LastMoveDeferred at 251.32472 Game - New active ControllerUILayer: Encounter (Stack size: 1) Game - Changed from NormalSelectedNode to DashNode Game - New active ControllerUILayer: EncounterDashMovement (Stack size: 1) **************************************** Stacktrace: **************************************** java.lang.IndexOutOfBoundsException: index can't be >= size: 0 >= 0 at com.badlogic.gdx.math.IntVector2Array.getX(IntVector2Array.java:71) at com.robotality.pulp.gameplay.queries.CommandQueries.queryWalkToCommand(CommandQueries.java:157) at com.robotality.pulp.gameplay.btree.nodes.gameflow.actions.move.MoveToAction.run(MoveToAction.java:61) at com.robotality.pulp.gameplay.btree.nodes.standard.AndNode.run(AndNode.java:20) at com.robotality.pulp.gameplay.btree.nodes.standard.OrNode.run(OrNode.java:21) at com.robotality.pulp.gameplay.btree.nodes.standard.RepeatUntilDone.run(RepeatUntilDone.java:22) at com.robotality.pulp.gameplay.btree.nodes.gameflow.GameEventNode.run(GameEventNode.java:56) at com.robotality.pulp.gameplay.TacticalSimulation.act(TacticalSimulation.java:371) at com.robotality.pulp.game.scene.GameScene.update(GameScene.java:358) at com.robotality.pulp.game.PulpHeroSceneContext.update(PulpHeroSceneContext.java:34) at com.robotality.pulp.game.screens.AbstractLevelScreen.lambda$update$12(AbstractLevelScreen.java:165) at com.robotality.pulp.game.PulpHeroSceneType.forType(PulpHeroSceneType.java:47) at com.robotality.pulp.game.PulpHeroSceneType.forEachType(PulpHeroSceneType.java:55) at com.robotality.pulp.game.screens.AbstractLevelScreen.update(AbstractLevelScreen.java:165) at com.robotality.pulp.game.screens.LevelScreen.update(LevelScreen.java:164) at com.robotality.game.screens.GameScreenAdapter.update(GameScreenAdapter.java:134) at com.robotality.pulp.PulpHeroAdapter.update(PulpHeroAdapter.java:92) at com.robotality.game.loop.FixedTimeStepGameLoop.render(FixedTimeStepGameLoop.java:48) at com.robotality.game.adapter.GameApplicationAdapter.render(GameApplicationAdapter.java:151) at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:335) at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.renderThreadFunction(Lwjgl3Application.java:205) at java.lang.Thread.run(Thread.java:745)
< >
Showing 1-1 of 1 comments
Man of God 14 Aug, 2023 @ 12:19am 
I pay for GPT-4 which is extremely good at code debugging compared to GPT-3.5 and here's what it had to say:

This stack trace provides information about an exception being thrown in a Java application that uses the LibGDX library. Here's the breakdown of the stack trace:

Error:
java.lang.IndexOutOfBoundsException: index can't be >= size: 0 >= 0

This error is an
IndexOutOfBoundsException
, indicating that an attempt was made to access an element at an invalid index of some collection or array.

Specifically, the message
index can't be >= size: 0 >= 0
suggests that the code tried to access the element at index 0 of an empty collection or array (whose size is 0).

Root Cause:
The root of this exception occurs here:

com.badlogic.gdx.math.IntVector2Array.getX(IntVector2Array.java:71)

This suggests that the application tried to access an x-coordinate of an IntVector2Array object, but the array is empty.

Propagation:
    The error propagates through a sequence of method calls:
  • There's a behavior tree (probably for AI or some game logic) being evaluated, as indicated by nodes like MoveToAction, AndNode, etc.
  • The MoveToAction.run method calls the queryWalkToCommand which, in turn, attempts to access an IntVector2Array object.
  • This call hierarchy continues up through a game update loop, with the TacticalSimulation.act method being one of the higher-level methods involved.
  • Eventually, this reaches the core game loop (FixedTimeStepGameLoop.render) and the rendering method in the LibGDX backend (Lwjgl3Window.update).

Solution:
  • Check the code inside
    CommandQueries.queryWalkToCommand
    (specifically line 157). It seems there's an assumption that
    IntVector2Array
    contains at least one element, but in this instance, it doesn't.
  • Add a check before accessing any element of the IntVector2Array to ensure it is not empty. Handle the case when it is empty appropriately – either by providing a fallback behavior, logging a warning, or skipping the operation.
  • Ensure that the logic populating the IntVector2Array is working as expected and filling it with the required data.
    Additionally, make sure to have comprehensive unit tests in place for scenarios like this to catch such issues early during development.
Last edited by Man of God; 14 Aug, 2023 @ 12:23am
< >
Showing 1-1 of 1 comments
Per page: 1530 50