Forum rules - please read before posting.

Potential bug with Action List -> Run that causes it to advance prematurely

edited June 2024 in Technical Q&A

Hi

I believe we've encountered a bug with Action List -> Run when Wait until finish is enabled - it will continue to the next action in some cases before the action list its running has finished. This occurs if that action list its running contains a Dialog -> Start Conversation action. As soon as the Start Conversation action runs, the parent action list continues and the action list its running gets ends (OnEndActionList is fired)

To reproduce:
1. Create a cutscene that includes a Dialog -> Start Conversation action surrounded by other actions (in our case Dialog -> Play speech). The cutscene is placed in scene and pauses gameplay. Skippable is irrelevant. Important: The Start Conversation action does not stop the action list for any path. All the options continue to another action in the list.
2. Create a Trigger that contains a Action List -> Run amongst other actions. Source is in scene. When running is set to Pause Gameplay. ActionList is the cutscene from above. Check/enable Wait Until finish. Set After running to Continue.
3. Add any action after the Action List -> Run and set a breakpoint in its Run() function.

Result: Run the game enter the trigger volume and see how as soon as the Dialog -> Start Conversation action is it, the break point is hit.

Expected: The entire action list being executed by Action List -> Run finishes running before continuing to the next action.

Note
The above is a test case, as this issue was actually found in a custom action I'm making that runs other actions (intro cinema, etc). I modelled this action after Action List -> Run.
I've noticed that as soon as the Conversation action plays, then:

  • KickStarter.actionListManager.IsListRunning( myList ) returns false.
  • KickStarter.actionListManager.IsListRegistered( myList) returns false.
  • ActionListManager::activeLists does not contain the list.
  • I listen for for OnPauseActionList and OnEndActionList.
  • OnEndActionList is fired with my nested list as the parameter (even though its not finished).
  • OnPause is not fired.
  • AC version is 1.79.3

I came up with the repro case to ensure that I didnt break it. No native AC code has been changed.

Any ideas on this? I'll continue to debug, but having this behavior work is critical to the custom action im working on.

If this is expected or not fixable - How would you recommend that a custom action list can:
1. Run another action list
2. Be notified when the entire list has finished running (stopped) even if it contains a Start Conversation action :).

Thanks

Comments

  • edited June 2024

    After digging more and stepping through the code, I was led to https://adventurecreator.org/forum/discussion/8478/awaiting-action-list-that-contains-a-start-conversation-action-fails - looks like a known issue.

    Reviewing that thread, thinking it through, then Ill update.

    Do any other actions exhibit this behavior or is Start Conversation the only one?

  • edited June 2024

    So sadly it looks like this is expected behavior. When a Conversation action is run, it stops the action list (and then reruns it later). This in turn causes the OnEndActionList event to fire.

    Assuming the above is correct, then:

    • I have a custom action that runs other actions lists.
    • My action needs to know when the action list it is running is complete (not stopped and then resumed due to it potentially containing a Conversation).
    • The action list it is running might have a Conversation with "Override defaults" set - becasue the action script needs do do different things depending on the response. (Design wants to play different speeches based on the players response)
    • I know you say "you can just create a new Cutscene with a single ActionList: Run Action that all the end-points then run.". I dont think this will work in my case as my custom action is essentially a state machine in script. When it runs a action list it then polls KickStarter.actionListManager.IsListRunning( childList ) and/or wait for OnEndActionList to fire with the correct action list ending and then moves to a new state.

    Other questions:

    • If "override defaults" is turned off, is there a way to determine what the line/choice was from the previous conversation was? While not ideal, I could tell design they need to use this method. That way we can not set override defaults and set "wait until Finish" then in the main action list check the last response conversation response and do stuff :). If this isnt possible, perhaps I could cache the last conversation index and then write an action to retrieve it. I know this wont work across scenes and has other issue, etc. In our case I think it will be ok as I can ensure they only use it in this specific situation.
    • In the above link you say "If you rely on a DialogOption ActionList for each response, you can have the Conversation Action wait until those responses are complete.". Could you explain this in more detail? I dont understand what you mean by DialogOption ActionList and Conversation Action.
  • The issues with the ActionList: Run Action running nested Conversations were discussed most recently here.

    It looks like your topic overlaps that discussion, which should be resolved in the latest release, v1.81.3.

  • Hi

    Thanks Chris. The link you provided is very similar to what I saw stepping through the code: Conversations end prematurely even if wait until complete is set.

    We are in the midst of a milestone and I'm nervous to update to a newer version and break things. I know its a big ask, but would it be possible to get a diff of the CL that fixes the issue? I can hand merge it it.

    Alternately, if you could even confirm if the change if specific to a few files (likely Conversation.cs and ActionConversation.cs Ill update to the newest version locally and see if I can merge just the fix). I know there could be dependencies on other CLs.

    Thanks again - I'm impressed over and over by the quality, architecture, and extendibility of this product.

  • The fix involved a number of different files - I'd start with copying over the ActionRunActionList, ActionListManager, and Conversation scripts from the latest release and see if that compiles.

  • Will do. Ill diff them, see if the changes make sense and go from there.

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.