How to load all animations before the scene starts?

  • #20, by MachtnixSunday, 05. June 2016, 21:56 8 years ago
    Thx. I have all of this Vis-exe install files on my harddisk. I hope, I can increase it into full version and use it without a new download (~83 MB is really too big to me).
    But preload isn't my priority topic now.

    Thread Captain

    1097 Posts


  • #21, by sebastianSunday, 05. June 2016, 22:24 8 years ago
    tested it right now. 4.2.5 seems to have problems with "preload animation" also on mac osx. 4.2 itself worked fine.
    Hope to see a fix in 4.3 smile

    Thread Captain

    2346 Posts

  • #22, by brut69Tuesday, 07. June 2016, 19:01 8 years ago
    I found that instead of loading/unloading animations that are very "heavy" that sometimes it is best , if the scene that I am doing is more of a cutscene , to do it as a video. Screencapturing it once and then showing that video instead of having the player's pc do all that trouble. This ofcourse increases the size of the game but it makes it removes the memory issue

    Great Poster

    266 Posts

  • #23, by MachtnixTuesday, 07. June 2016, 20:30 8 years ago
    Sounds interesting. But I'm a fool how to put whole screen videos instead of the regular game scene and find it's correct position. Mostly the animations are character outfits or layer animations (maybe a bird flying from left to right or loops of fire or clouds) or s.th like that, means: only parts of the screen.
    Because it's possible that a huge animation runs smoothly it depends on a bug into the engine. If it don't run smoothly it would be another reason but it runs... so what.
    Btw.: my 4.2.5-file don't work properly in 4.2 or don't start at all. I have to use 4.2.5 until the end... ;-)

    Thread Captain

    1097 Posts

  • #24, by afrlmeTuesday, 07. June 2016, 20:51 8 years ago
    @ brut69: this would only work for static scenes, that don't have any background animations / particle effects, etc.

    @ Machtnix: it should work, but you might have to tweak the odd thing to make it work properly again, but only if you are using features that are unique to 4.2.5, that didn't exist in 4.2. Other than that, they should be back compatible with all versions of 4.x.

    Imperator

    7278 Posts

  • #25, by MachtnixTuesday, 07. June 2016, 21:10 8 years ago
    Thx, AFRLme. I'm going to download the 4.2 full to test it, because in one of my games I use a really huge animation which stays huge as compressed webp (it's a full screen star field runnning up to down behind my shooting spaceship, to make it smoother I use 15 frames/s and a long loop time, I don't know how to make it more efficient another way...).

    Thread Captain

    1097 Posts

  • #26, by afrlmeTuesday, 07. June 2016, 21:29 8 years ago
    You could make it at say 25% of actual intended scale & then use Lua to scale the animation up to 100% (Animation size of 400), which would reduce the filesize & so on even more.

    Alternatively, you could probably create a few static images & use Lua to move them about - I don't know if this would be a valid method as I have no idea what your animation looks like.

    Imperator

    7278 Posts

  • #27, by MachtnixTuesday, 07. June 2016, 21:50 8 years ago
    Yes, I tried this static picture thing, but I can't realize a Lua script to move the background picture from up to down. Meh.
    Assumed I have a screen of 800 x 600 px I can use a background picture of maybe 2400 x 800 px to slide down faking a moving sky. It's only white star dots on black, in 3D I prefer a procedural shader without any graphic :-)

    Thread Captain

    1097 Posts

  • #28, by afrlmeTuesday, 07. June 2016, 22:46 8 years ago
    Each animation frame has the black background included in it? Create the stars on transparent canvas & add a static black image as a separate object. Removing the black from each frame will significantly reduce the file-size of each frame, by quite a far bit I should imagine.

    Would you be willing to show or send me the animation, so I can see exactly what it looks like? If you do I might be able to give you a quick Lua script to emulate the same effect, with just one animation frame.

    * edit: if you just want it to move down then you only need one line of code & a single animation (I recommend animation over pure object with static image as animations are much easier to move with absolute positioning). Technically you can move objects or animations with action parts too, but they don't have easing options.
    local anim = ActiveAnimations["stars"]
    anim:to(3000, {AnimationCurrentPosition = {x = anim.AnimationCurrentPosition.x, y = 2000}}, easeQuintOut) -- x stays the same, y moves to 2000px over 3000ms, with slow ease out.
    

    Imperator

    7278 Posts

  • #29, by bananeisafreeWednesday, 08. June 2016, 10:24 8 years ago
    I had similar problem with a 200 ish frame animation that started at the beggining of the scene,(a loop with a spaceship roaming around).
    The thing is; I think that the game did not manage to preload the whole animation before the first loop was launched. Wich made the first 10 seconds of the game quite laggy. The trick was to not put the animation into the default animation of the object, but rather call the animation on the 'at the beggining of the scene' after the preload animation.

    On other instance, having the preload animation set into an action that is called by 'at beggining of the scene' worked too. But I have no idea why .

    So yeah. Do not hesitate to mess around with vis. It seems to have strange esotherics behaviour sometime.

    Forum Fan

    120 Posts

  • #30, by afrlmeWednesday, 08. June 2016, 15:08 8 years ago
    @ Bananeisafree: I made a similar thing with a spaceship, except I only used 1 frame, as I sorted out the movement, scaling & rotation with Lua script. Both methods require a bit of work, whether you use script or pure animation, but Lua is more favorable as it reduced the loading time significantly, although moving with Lua doesn't always look as smooth (sometimes it skips a little for whatever reason).

    Imperator

    7278 Posts