Talk animation occasionally stops when there is a random loop in the scene (possible bug?) [Edit: FIXED]

  • #1, by fulviovTuesday, 14. July 2015, 01:40 5 years ago
    The talk animation of my character occasionally stops mid-sentence in a scene where I have random cars passing in the background.
    In the scene there is a loop that generates a random number from 1 to 5, picks a random car (which is a character) and moves it from x to y in the background, to give the impression of a trafficked road.

    I have tried disabling the random number generation, and the talk animation does not hang anymore, so I guess it is caused by that.
    I am attaching a screenshot of the actions I am using to generate the car-loop.

    Forum Fan

    119 Posts


  • #2, by afrlmeTuesday, 14. July 2015, 02:11 5 years ago
    Try adding a pause before the jump to action part #1. It might be worth considering creating a value & linking it to the pause & just before the pause you could add a set random value action part to generate a random amount of time in seconds or milliseconds which will determine the pause time between each loop.

    More likely than not the issue is caused by too much info on the screen at the same time for your machine to handle.

    Imperator

    6842 Posts

  • #3, by fulviovTuesday, 14. July 2015, 02:51 5 years ago
    I tried adding a 1 second pause before the jump as suggested, but unfortunately it did not help roll

    The loop itself is very slow, there is a wait for character to reach the end position before jumping to the start, and that takes around 5 seconds, so I don't think pausing is the issue...

    Also, forcing the random_car variable to 1 (and so having always the first car run in the background) fixes the problem, so I am afraid this is somehow related to the random number generator.

    Forum Fan

    119 Posts

  • #4, by sebastianTuesday, 14. July 2015, 08:57 5 years ago
    im curious if it helps when you disable the "wait" in the send character to action part and add after it a normal pause for the time it needs to go to that position...

    Thread Captain

    2337 Posts

  • #5, by fulviovTuesday, 14. July 2015, 11:24 5 years ago
    im curious if it helps when you disable the "wait" in the send character to action part and add after it a normal pause for the time it needs to go to that position...


    Just tried this as well - problem still present :S

    Forum Fan

    119 Posts

  • #6, by afrlmeTuesday, 14. July 2015, 14:36 5 years ago
    What happens if all 5 cars are running in the background? The loop & random scripting looks ok the me. The only thing I can think of is that you have too many animations being loaded at the same time.

    Try disabling / hiding the other car characters when they are not in use.

    Imperator

    6842 Posts

  • #7, by fulviovTuesday, 14. July 2015, 23:12 5 years ago
    I just tried to have all five cars running in the background at the same time, looping with no delay, no problems whatsoever. I have also added moving clouds in the background, still no problems.
    The issue is only present when there is the random value pickup at the beginning of the script.

    Forum Fan

    119 Posts

  • #8, by fulviovTuesday, 14. July 2015, 23:58 5 years ago
    I made a small video showing the issue:
    https://dl.dropboxusercontent.com/u/2732399/test_speech.mov

    the cars are still mockups (I am using coloured squares), but you can see them moving in the background. the first time I activate the blue test pixel on the floor, the first part of the speech animates ok but then it hangs, the second time I do it, there is a brief hang at the fist part but then the second part is ok.

    Forum Fan

    119 Posts

  • #9, by afrlmeTuesday, 14. July 2015, 23:59 5 years ago
    Strange. I don't see anything in the action block that would cause that issue - on the bright side, at least you've established it's not due to a lack of a powerful enough machine. grin

    I really don't know what to suggest. Are there any errors listed in the log?

    Imperator

    6842 Posts

  • #10, by fulviovWednesday, 15. July 2015, 00:10 5 years ago
    Nothing in the log, unfortunately. Oh well, guess I'll have to live with it, until I find an alternative way :S

    Forum Fan

    119 Posts

  • #11, by fulviovWednesday, 15. July 2015, 01:33 5 years ago
    I think I have found a solution, I am posting it here in case anybody will stumble onto this kind of problem someday.

    To fix it, I have placed all cars at the beginning of the scene at the starting position (which is hidden), preloading all of them. Doing this, the talking animation works just fine when they randomly get moved.

    My guess is that the problem isn't the random number generator, but having a character suddenly instantiated on the scene while the character is talking can stop the talking animation, for some reason.
    When I previously tested with all cars (as suggested by AFRLme), it worked fine because they all got instantiated at once when the scene started, but once I started calling them individually at random the issue appeared again.

    Forum Fan

    119 Posts

Write post