[Solved]Game freeze with Change character speed or double click?

  • #1, by wimfSaturday, 12. May 2018, 09:54 2 years ago
    Hello,

    During the beta test, players report that in some places, when he double clicks to accelerate the character, the game freeze between 5 and 20 seconds then unfreeze. After, the character walks quickly as programmed. I checked the pathfinding which is correct and the location of my objects is ok. It is strange because with a single click (normal character speed), this problem does not exist ...

    Double click action :

    Change character speed of 'Ben' to 20
    Wait until character 'Ben' stops
    Change character speed of 'Ben' to 6
    1
    2
    3


    This problem only happens in some rooms

    Can you help me ?

    Forum Fan

    238 Posts


  • #2, by afrlmeSaturday, 12. May 2018, 13:27 2 years ago
    Do you have anything else happening in the double click actions list? Is your walk using the default sliding walk system or the update position on each frame system? If it's the latter then the speed thing shouldn't work for it.

    Alternatively instead of using walk speed option you could try using my Lua script method if you want for changing the global delay values for each of the walk animations.

    execute a script >
    if game.CurrentCharacter.CharacterScene == game.CurrentScene then
     for i = 1, #game.CurrentCharacter.CharacterOutfits["default"].OutfitWalkAnimations do
      game.CurrentCharacter.CharacterOutfits["default"].OutfitWalkAnimations[i].AnimationPause = 20
     end
    end
    1
    2
    3
    4
    5
    wait until character "current character" stops
    execute a script >
    for i = 1, #game.CurrentCharacter.CharacterOutfits["default"].OutfitWalkAnimations do
     game.CurrentCharacter.CharacterOutfits["default"].OutfitWalkAnimations[i].AnimationPause = 40
    end
    1
    2
    3

    I update the global delay on double click if the current character is on the current scene, then I wait until the character stops & then I reset the global delay back to the default value.

    Imperator

    6771 Posts

  • #3, by wimfSaturday, 12. May 2018, 15:57 2 years ago
    Thank you

    When i use a default sliding walk or the update position on each frame, the problem is same

    I have try your script, but the problem is same

    When i double click, the game freeze. I do not understand why it's in some scenes but not all, because the scripts are the same ...

    Forum Fan

    238 Posts

  • #4, by afrlmeSaturday, 12. May 2018, 16:01 2 years ago
    Is there anything in the log?

    Imperator

    6771 Posts

  • #5, by wimfSaturday, 12. May 2018, 16:12 2 years ago
    Nothing

    Sorry, i have found the problem.  I have deleted and redraw the way points and it's working.

    I guess there was a complicated point in my way system that VS had hard to calculate and that it generated a lag.

    I think the info is interesting to know if this kind of problem happens to other VS users.

    Thank you for your help

    Forum Fan

    238 Posts

  • #6, by wimfSaturday, 12. May 2018, 16:22 2 years ago
    I confirm that the problem was my way points. I had done it like a spider's web, but there was too much combination to get to the same point. so I redid way points with an easier and more logical way and it works.

    Forum Fan

    238 Posts

  • #7, by afrlmeSaturday, 12. May 2018, 16:59 2 years ago
    Ah, ok. Nice one on figuring out the issue. smile

    Quick note: there isn't much point in overly complicated way system paths because most of the time the engine is going to automatically calculate the most direct route from the current position to the destination position. Way system paths are only really used for scaling & for handling paths around cutout way system borders inside of the main way system area.

    Imperator

    6771 Posts

  • #8, by wimfSaturday, 12. May 2018, 17:17 2 years ago
    Thank you for this info. Have a nice day

    Forum Fan

    238 Posts

Write post