Forum rules - please read before posting.

Invalid node target

edited October 2021 in Technical Q&A

Hi all,

I unfortunately have issues with players pathfinding for a while now.

Here's the warning from the console:

Invalid node target - cannot update pathfinding on Jay

-> AC debug logger
UnityEngine.Debug:LogWarning (object,UnityEngine.Object)
AC.ACDebug:LogWarning (object,UnityEngine.Object) (at Assets/AdventureCreator/Scripts/Static/ACDebug.cs:33)
AC.Char:PathUpdate () (at Assets/AdventureCreator/Scripts/Character/Char.cs:771)
AC.Char:BaseUpdate () (at Assets/AdventureCreator/Scripts/Character/Char.cs:627)
AC.Player:_Update () (at Assets/AdventureCreator/Scripts/Character/Player.cs:180)
AC.StateHandler:Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:265)

I played around a lot with the path finding settings e.g. update time & accurancy. But couldn't fix it.
When it happens the Player walks forever on the same spot. In normal game mode, to trigger a new action gets the player out of this state. If this happens in a cutscene / gameplay paused, there is no other way than to end the game and restart it. (User will loose it's progress most probably).
The warning get spammed in the console. So it hits the LogWarning most probably on each pathfinding update cycle.
First users complain about this in my Demo release, so seems not to be a "local" problem.

It's:
targetNode == -1 || targetNode >= activePath.nodes.Count

To mitigate the problem I added a
EndPath();
and currently trying to unpause and save the game in this if-clause.

But in best case there is a fix for the root cause, which I could not find up until now. So I'm a little lost.

Any ideas?

Unity: 2020.3.14f1
AC: v1.73.2

Comments

  • Is this for a 2D or 3D game?

    I'll need be able to recreate the original issue in order to understand what's going on.

    Can you provide steps on how to recreate this issue? Is there a pattern to when it occurs, allowing you to trigger it reliably at a given time?

  • Hi Chris,
    it's a 2d game.
    For now, I can't reproduce it reliably. Only thin I notice is, that the game is slow in general when it happens. e.g. some animation frames skipped... But don't know if its related. I only have seen in in the unity game window, but users seems to experience it in the final build as well.

  • Anything to collect / to do when it happens next time?

  • Use Unity's Profiler window, with Deep Profile enabled, to try to determine the cause of the slowness. Try this in a duplicate project with the latest AC release, as some performance issues in the Editor were recently addressed.

  • Ok. Might take a while (not familiar with the profiler). I will post once I have results.

  • edited October 2021

    So first finding. If I have Action List windows open and restart unity it "remembers" that there was a AL window open. So I can find it in "Windows->Panels->. But it starts in the background / minimized,so for me unrecognized. In those windows no action list is assingned. I had e.g. 5-6 of them without knowing. Profiling the Editor now showed that updating these windows caused 95% CPU load. Closed them all and the Editor & Game window runs with high performance & framerate again.
    This is still with the "old" version of AC. I will try soon, if it happens with the latest release as well.

    But this can not be the full story, because in the compiled builds this can't be the issue. I will try to catch the issue with the "invalid target node" again with the profiler on.

    Do you see a way to mitigate the problem by "restarting" last path finding or resetting the target node?

  • I can look into the CPU load for such ActionList windows - thanks for the details - but it will be unrelated to the node issue.

    I can't advise about the best way to mitigate the issue until we learn the cause, though. The more detail you can share about your scene/game/how this issue occurs, the more I have to go on.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.