Animations with over 1024 frames

From FSDeveloper Wiki
Revision as of 09:06, 3 March 2016 by MichaelCox (talk | contribs) (minor updates)
Jump to navigationJump to search

The FS2004 MakeMDL has a limitation build in that it can only export animations with a length of 1024 frames. Because the animation timer is a 18 Hz timer that means that the maximum animation length is only about 55 seconds. That might be fine for a hangar door that is opening or a radar that is rotating, but if you want to make some animated traffic on your airport for example 55 seconds is a bit short.

Unfortunately there is no workaround for this limitation from within GMax, but when you start editing the ASM code of your object it is possible to get beyond 1024 frames for an animation. So the limitation is purely in MakeMDL, not in FS2004 itself. This tutorial will explain which pieces of the ASM code you have to edit to make a longer animation.

Although I will try to explain everything as clearly as possible, I would say this is a task that a novice scenery designer might find a bit hard. But if you are a little bit familiar with ASM tweaking then I hope this tutorial will give you enough knowledge of how the animations are defined to be able to tweak them. Let's get started.

Exporting the animation

Basically exporting an animation with more than 1024 from gmax is not possible. MakeMDL simply ignore the animation from the export if the animation is longer than 1024. If we want to export the animation we need to export it by every 1024 frames. If the export is ready we have to combine the parts to one complete file manually. In this section we try to explain how to do it.

Step1: First of all create your animation in gmax with the full length. Let's say your animation is 2048 frames long.

Step2: If it is ready open the time configuration panel and change the end-frame to 1023. Press OK. Export your model, name it e.g. anim1.mdl (of course you have to keep the asm file with the exporter as we will tweak the asm).

Step3: When ready open the time configuration panel in gmax again and set the time parameters start frame :1024- end frame 2048. Press okay and open the time configuration button again. Press the Re-Scale button and re-scale the animation, start frame 0, end frame 1023. This step will forward the second part of the animation to the 0 point to be able to export it.

WARNING! After this step do not save your gmax file otherwise you will loose the first part of your animation!

This step becomes more complex if your animation is longer than 2048 frames. In that case in the Re-Scale part you have to set the end date of the previous end date minus 1024 frames not to loose the remaining animation. Do not forget! One part what you export can not be longer than 1024 frames! Maybe if you want to make it easier export your animation by 1000 frames.

Step4: Export the second part now to anim2.mdl.

Re-Number the animation keyframes

Our next steps is to combine the two animation into one again in the asm manually. We need to copy the animation tables from the anim2.mdl and paste them to anim1.mdl. That is unfortunately is not so easy. As the second part we have exported with start frame of 0, of course in our asm file the frame numbers will start with 0 as well. Of course this would cause a problem as we have already the same frame numbers in the first mdl. We need to re-number the second part asm frame numbers. To do this there is an MS Excel file attached.

Open your anim2_0.asm copy the keyframes section and paste it to the excel file (Column 'A'). In the excel file you can find a field 'Start Frame'. Enter the starting frame what you wish re-number your keyframes, in our case it is the 1024. The Excel will change all the keyframes and he will give the result in column 'B'. Select the column 'B' result and copy it, than paste it to your anim1_0.asm to the right position. All animation has two animation kayframe table, both has to be changed by the excel, it can handle both. Of course if you have several parts you have to repeat this step till you get a continuous sequenced animation keyframe table in anim1_0.asm.

The method will be more complex if in your animation several objects has animation. Every object has a separate animation keyframe table and you have to take care that you do not mix-up the object in your final anim1_0.asm.

The next sections describes what else need to be changed in the final asm file. Bold text

Tweaking the animation

There are two sections of the ASM code where you will have to make changes. The first is the section with the animation tables (ANIP) and the second is the section where the actual interpolation for the animation is performed (ANIC). Which changes to make in these two seconds is discussed next.

Animation tables

In this section I will describe which changes you need to make in the animation tables. There are two sorts of tables you will have to change. The first is the table that stores your animation keyframes and the second is the table that is used to determine the frame for the animation timer variable.

Keyframes table

The animation keyframe table stores all the keyframes of your animation. They contain of an frame number and then the actual data. This can be 3 values for a position or 4 for a rotation (given as a quaternion). Below you see a sample of how the keyframe table can look for a simple translation of 1024 frames.

 anim_long_trans_1       label word
     dw           1       ; 1: Point (translation) 
     real4     -1.0       ; Previous panim value
     real4 16 dup (0.0)   ; Cached matrix 
     dw           2       ; number of entries
     real4       0.0,   0.000000,  0.000000,  0.000000 ; frame/x/y/z values
     real4    1023.0, 100.000000,  0.000000,  0.000000 ; frame/x/y/z values

As we want to get a longer animation, it is obvious that we need to add more keyframes to this table. So you will have to add additional lines until you reach the length in frames you want for your animation. Below you see an example where I extended the table to 4096 frames in total.

 anim_long_trans_1       label word
     dw           1       ; 1: Point (translation) 
     real4     -1.0       ; Previous panim value
     real4 16 dup (0.0)   ; Cached matrix 
     dw           5       ; number of entries
     real4       0.0,   0.000000,   0.000000,  0.000000 ; frame/x/y/z values
     real4    1024.0, 100.000000,   0.000000,  0.000000 ; frame/x/y/z values
     real4    2048.0, 100.000000, 100.000000,  0.000000 ; frame/x/y/z values
     real4    3072.0, 200.000000, 100.000000,  0.000000 ; frame/x/y/z values
     real4    4095.0, 200.000000,   0.000000,  0.000000 ; frame/x/y/z values

How you get the data to extend the keyframe table is up to you. Obviously GMax can not export the longer table for you. So you either have to type ... \n

private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm

Offers private label cosmetics with custom design. We produce lip balms, serum, creams and more. Easy to buy with eshop. Private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm

[private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm]

[private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm]

private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm

Offers private label cosmetics with custom design. We produce lip balms, serum, creams and more. Easy to buy with eshop. Private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm

[private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm]

[private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm]

private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm

Offers private label cosmetics with custom design. We produce lip balms, serum, creams and more. Easy to buy with eshop. Private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm

[private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm]

[private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm]

private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm

Offers private label cosmetics with custom design. We produce lip balms, serum, creams and more. Easy to buy with eshop. Private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm

[private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm]

[private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm]

private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm

Offers private label cosmetics with custom design. We produce lip balms, serum, creams and more. Easy to buy with eshop. Private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm

[private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm]

[private label cosmetics, custom made cosmetic, custom made cream, custom lip stick lip balm]