How to load all animations before the scene starts?

  • #1, z AkcayKaraazmakSaturday, 04. June 2016, 15:58 hodinky 9 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

    Čestný člen

    440 Posts


  • #2, z afrlmeSaturday, 04. June 2016, 16:40 hodinky 9 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?

    Imperátor

    7285 Posts

  • #3, z AkcayKaraazmakSaturday, 04. June 2016, 18:06 hodinky 9 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!

    Čestný člen

    440 Posts

  • #4, z afrlmeSaturday, 04. June 2016, 18:58 hodinky 9 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.

    Imperátor

    7285 Posts

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

    Čestný člen

    440 Posts

  • #6, z afrlmeSaturday, 04. June 2016, 19:53 hodinky 9 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.

    Imperátor

    7285 Posts

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

    Čestný člen

    440 Posts

  • #8, z afrlmeSaturday, 04. June 2016, 20:55 hodinky 9 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.

    Imperátor

    7285 Posts

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

    Čestný člen

    440 Posts

  • #10, z MachtnixSaturday, 04. June 2016, 23:58 hodinky 9 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.

    Kapitán

    1097 Posts

  • #11, z AkcayKaraazmakSunday, 05. June 2016, 00:05 hodinky 9 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?

    Čestný člen

    440 Posts