How to load all animations before the scene starts?

  • #1, by AkcayKaraazmakSaturday, 04. June 2016, 15:58 4 years ago
    Hi guys,

    My problem is, on one scene I have many animation objects with many frames. So when this scene starts, all these animations play very slow at the first time but then after they played once, they start to play with their normal speed. So is it possible to load al these animations before the scene starts, so all the animation will be played with their actual speed.

    Cheers smile

    Great Poster

    437 Posts


  • #2, by afrlmeSaturday, 04. June 2016, 16:40 4 years ago
    That's what the "preload" animation / character animations action part is for.

    Quick note: that will slow down your game while it's storing animations to memory so it's best if you do this in a loading screen of some sorts. How long it takes to load is guess work as there's currently no way of checking the loading progress & the time will vary depending on each individuals computer.

    Have you checked out the optimization tip page I added to the wiki ages ago?

    Imperator

    6815 Posts

  • #3, by AkcayKaraazmakSaturday, 04. June 2016, 18:06 4 years ago
    Hey Lee! Thank you mate smile I used the preload thing at the beginning of scene and everything is great now! Thank youuuuu!

    Great Poster

    437 Posts

  • #4, by afrlmeSaturday, 04. June 2016, 18:58 4 years ago
    Remember you need to unload the animations manually at the end of the scene or when you no longer need them, as over time (current play session) they will cause your game to run slow.

    Imperator

    6815 Posts

  • #5, by AkcayKaraazmakSaturday, 04. June 2016, 19:03 4 years ago
    Thank you Lee. I put the unload command on the last frame of the animations. I think it unloads them, isnt it?

    Great Poster

    437 Posts

  • #6, by afrlmeSaturday, 04. June 2016, 19:53 4 years ago
    You mean the "stop animation" action part? No, that just stops them from playing. I don't think it erases the animations from memory if you preloaded them, as preloaded animations are stored in a special cache & stay there until you remove them with one of the remove preloaded animation action parts.

    The best place to add the remove preloaded animation actions is inside of an at end of scene action.

    Imperator

    6815 Posts

  • #7, by AkcayKaraazmakSaturday, 04. June 2016, 20:01 4 years ago
    Aa ok I see Lee. Yea I'll change them with at the end of scene action. Thank you again bro!

    Great Poster

    437 Posts

  • #8, by afrlmeSaturday, 04. June 2016, 20:55 4 years ago
    No problem mate. wink

    Quick note: regularly played animations get added to a temp cache once they have been loaded. They will automatically get removed from the cache once stopped & as more new animations are triggered. At least this is how I think it works.

    Imperator

    6815 Posts

  • #9, by AkcayKaraazmakSaturday, 04. June 2016, 21:12 4 years ago
    Allright mate, I understand.Thank you again

    Great Poster

    437 Posts

  • #10, by MachtnixSaturday, 04. June 2016, 23:58 4 years ago
    Hm, sure this preload works? I tried it again and again - at the beginning of the scene, at the beginning of the game, with load there and unload there and a million other cases - but no effect. Never. Often the animations didn't play anywhere.

    The only thing which works (at my pc) is to play all used animations once before showing them on the scene. After playing they are in the cache (mostly). But that's foolish - I have to hide the playing animations with a cover object before starting the game - and of course it takes a lot of time to play the animations behind them at/in the background.

    You can test the used memory in the player pressing the "pos1" button.

    Thread Captain

    1078 Posts

  • #11, by AkcayKaraazmakSunday, 05. June 2016, 00:05 4 years ago
    No mate, I just tried and it realy worked! I just write the action preload"..." in the "at beginning of scene" event. And wrote unload in the "at the end of scene" event. its worked perfectly. Did you try it like this?

    Great Poster

    437 Posts

Write post