• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Animations with over 1024 frames

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
34,536
Country
netherlands
I have good news. The last few days I have been studying on the animation source codes again, to try to make an animation of a car that drives around an airport and uses more than 1024 (so more than 55 seconds). I can tell you that I got it working, have a look at my blog post about it for more details.

At the moment I got it working with a lot of manual tweaking of the ASM code, so that will probably not be attractive to many of you :). I will try to describe the tweaks in an article soon and after that we might be able to think of a nice tool to implement it as well. Any ideas on such a tool are welcome (for example how would you like to use it).
 
Here is a very quick "tutorial" to show which changes I made to the ASM code. This will probably not be of help for novice users, but I plan to write a better article soon (on the Wiki).

This is the origional table code as created by GMax:

Code:
test_1_tick18_mod_1 label word
    dw  8
    dw -32768,0,-16386,16383
    dw -16384,0,-2,16383
    dw 0,0,16382,16383
    dw 16384,0,32766,16383
test_1_tick18_mod_2 label word
    dw  32
    dw 0,0,1023,1023
    dw 1024,0,2047,1023
    dw 2048,0,3071,1023
    dw 3072,0,4095,1023
    dw 4096,0,5119,1023
    dw 5120,0,6143,1023
    dw 6144,0,7167,1023
    dw 7168,0,8191,1023
    dw 8192,0,9215,1023
    dw 9216,0,10239,1023
    dw 10240,0,11263,1023
    dw 11264,0,12287,1023
    dw 12288,0,13311,1023
    dw 13312,0,14335,1023
    dw 14336,0,15359,1023
    dw 15360,0,16383,1023
test_1_float_convert_hi  label word
    dw  12               ; num entries
    dw  0,0
    dw  1,16256
    dw  2,16384
    dw  4,16512
    dw  8,16640
    dw  16,16768
    dw  32,16896
    dw  64,17024
    dw  128,17152
    dw  256,17280
    dw  512,17408
    dw  1024,17536
test_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
    real4    1023.0,  0.000000,  9.990234,  0.000000

And this is the orgional interpolation code:

Code:
bgl_animation_command_start_test_1	label	BGLCODE
    ; usrvar = tick18 mod 1024
    LOCAL_BASE_32 test_1_tick18_mod_1
    BGL_INTERPOLATE VAR_BASE_GLOBAL,BGL_TICK18,\
                    VAR_BASE_GLOBAL,usrvar,\
                    VAR_BASE_LOCAL,(offset test_1_tick18_mod_1 - offset test_1_tick18_mod_1)
    LOCAL_BASE_32 test_1_tick18_mod_2
    BGL_INTERPOLATE VAR_BASE_GLOBAL,usrvar,\
                    VAR_BASE_GLOBAL,usrvar,\
                    VAR_BASE_LOCAL,(offset test_1_tick18_mod_2 - offset test_1_tick18_mod_2)
    ; convert usrvar to float and store in usrvr2-usrvr3
    LOCAL_BASE_32 test_1_float_convert_hi
    BGL_INTERPOLATE VAR_BASE_GLOBAL,usrvar,\
                    VAR_BASE_GLOBAL,usrvr3,\
                    VAR_BASE_LOCAL,(offset test_1_float_convert_hi - test_1_float_convert_hi)
    VAR_BASE_32   VAR_BASE_GLOBAL
    SETWRD usrvr2,0
    IFIN1 test_1_fc_512, usrvar,257,512
    IFMSK test_1_fc_512, usrvar,0001h
    SETWRD usrvr2,08000h
test_1_fc_512 label word
    IFIN1 test_1_fc_1024, usrvar,513,1024
    IFMSK test_1_fc_1024, usrvar,0003h
    SETWRD usrvr2,04000h
    IFMSK test_1_fc_1024, usrvar,0002h
    SETWRD usrvr2,08000h
    IFMSK test_1_fc_1024, usrvar,0001h
    SETWRD usrvr2,0C000h
test_1_fc_1024 label word
    LOCAL_BASE_32 test_trans_1
    BGL_ANIMATE_INDIRECT   VAR_BASE_GLOBAL,usrvr2,VAR_BASE_LOCAL,(offset test_trans_1 - offset test_trans_1),0.0,0.0,0.0,1
 bgl_animation_command_end_test_1	label	BGLCODE

Now with the changes. This is my new table code:

Code:
test_varbase label word
    dw 0
    dw 0
    dw 0
    dw 0
    dw 0
    dw 0
test_1_tick18_mod_1 label word
    dw  8
    dw -32768,0,-16386,16383
    dw -16384,0,-2,16383
    dw 0,0,16382,16383
    dw 16384,0,32766,16383
test_1_tick18_mod_2 label word
    dw  8
    dw 0,0,4095,4095
    dw 4096,0,8191,4095
    dw 8192,0,12287,4095
    dw 12288,0,16383,4095
test_1_float_convert_hi  label word
    dw  14               ; num entries
    dw  0,0
    dw  1,16256
    dw  2,16384
    dw  4,16512
    dw  8,16640
    dw  16,16768
    dw  32,16896
    dw  64,17024
    dw  128,17152
    dw  256,17280
    dw  512,17408
    dw  1024,17536
    dw  2048,17664
    dw  4096,17792
test_trans_1       label word
    dw           1       ; 1: Point (translation)
    real4     -1.0       ; Previous panim value
    real4 16 dup (0.0)   ; Cached matrix
    dw          29       ; number of entries
    real4     0.00,  140.73,  -169.70,  0.00
    real4   312.73,  342.94,  -183.75,  0.00
    ...
    ...

And this is the new interpolation code (the part you are missing):

Code:
bgl_animation_command_start_test_1	label	BGLCODE

    LOCAL_BASE_32 test_varbase
    BGL_INTERPOLATE VAR_BASE_GLOBAL,BGL_TICK18,\
                    VAR_BASE_LOCAL,0h,\
                    VAR_BASE_LOCAL,(offset test_1_tick18_mod_1 - offset test_varbase)
    BGL_INTERPOLATE VAR_BASE_LOCAL,0h,\
                    VAR_BASE_LOCAL,0h,\
                    VAR_BASE_LOCAL,(offset test_1_tick18_mod_2 - offset test_varbase)

    BGL_INTERPOLATE VAR_BASE_LOCAL,0h,\
                    VAR_BASE_LOCAL,4h,\
                    VAR_BASE_LOCAL,(offset test_1_float_convert_hi - offset test_varbase)

    SETWRD 2h,0
    IFIN1 test_1_fc_512, 0h,257,512
    IFMSK test_1_fc_512, 0h,0001h
    SETWRD usrvr2,08000h
test_1_fc_512 label word
    IFIN1 test_1_fc_1024, 0h,513,1024
    IFMSK test_1_fc_1024, 0h,0003h
    SETWRD 2h,04000h
    IFMSK test_1_fc_1024, 0h,0002h
    SETWRD 2h,08000h
    IFMSK test_1_fc_1024, 0h,0001h
    SETWRD 2h,0C000h
test_1_fc_1024 label word
    IFIN1 test_1_fc_2048, 0h,1025,2048
    IFMSK test_1_fc_2048, 0h,0007h
    SETWRD 2h,02000h
    IFMSK test_1_fc_2048, 0h,0006h
    SETWRD 2h,04000h
    IFMSK test_1_fc_2048, 0h,0005h
    SETWRD 2h,06000h
    IFMSK test_1_fc_2048, 0h,0004h
    SETWRD 2h,08000h
    IFMSK test_1_fc_2048, 0h,0003h
    SETWRD 2h,0A000h
    IFMSK test_1_fc_2048, 0h,0002h
    SETWRD 2h,0C000h
    IFMSK test_1_fc_2048, 0h,0001h
    SETWRD 2h,0E000h
test_1_fc_2048 label word
    IFIN1 test_1_fc_4096, 0h,2049,4096
    IFMSK test_1_fc_4096, 0h,000Fh
    SETWRD 2h,01000h
    IFMSK test_1_fc_4096, 0h,000Eh
    SETWRD 2h,02000h
    IFMSK test_1_fc_4096, 0h,000Dh
    SETWRD 2h,03000h
    IFMSK test_1_fc_4096, 0h,000Ch
    SETWRD 2h,04000h
    IFMSK test_1_fc_4096, 0h,000Bh
    SETWRD 2h,05000h
    IFMSK test_1_fc_4096, 0h,000Ah
    SETWRD 2h,06000h
    IFMSK test_1_fc_4096, 0h,0009h
    SETWRD 2h,07000h
    IFMSK test_1_fc_4096, 0h,0008h
    SETWRD 2h,08000h
    IFMSK test_1_fc_4096, 0h,0007h
    SETWRD 2h,09000h
    IFMSK test_1_fc_4096, 0h,0006h
    SETWRD 2h,0A000h
    IFMSK test_1_fc_4096, 0h,0005h
    SETWRD 2h,0B000h
    IFMSK test_1_fc_4096, 0h,0004h
    SETWRD 2h,0C000h
    IFMSK test_1_fc_4096, 0h,0003h
    SETWRD 2h,0D000h
    IFMSK test_1_fc_4096, 0h,0002h
    SETWRD 2h,0E000h
    IFMSK test_1_fc_4096, 0h,0001h
    SETWRD 2h,0F000h
test_1_fc_4096 label word

    BGL_ANIMATE_INDIRECT   VAR_BASE_LOCAL,2h,VAR_BASE_LOCAL,(offset test_trans_1 - offset test_varbase),0.0,0.0,0.0,1

 bgl_animation_command_end_test_1	label	BGLCODE

Hope this is clear (for now)!
 
This is good news, Arno. :)
I still hope that the FSX will have less restrictions than FS9.

I'll try this method in my next project though. ;)
 
Super!! Arno, you're the man!
Looking forward to your upcoming post in your blog and to the future tool :)

Jeff
 
ThankZ arno..Just caught this..and I have a test object moving around at a cOOl 2048 instead of 1024..This will be a big anim improvement..I wonder how far it can go? I will be testing this also..If it moves smooth enough you could have an Fs animation programa` on hand here..I would like to make my red lights change even slower..or the space shuttle go higher..thanks a big lOts :D
 
Hi Arno.

I contacted "tdragger" at AVSIM.

Hi tdragger.

I been reading about Arno Gerretsen's investigation of the animation frame limits of our scenery. Basically, Arno has discovered that the 1024 frame limitation is caused by MakeMDL... not by gmax or the FS2004.

http://www.scenerydesign.org/blog/category/Scenery-design/

I'm hoping this limitation will be increased for FSX with your gmax/3ds converion modules. ( Perhaps even a new release of MakeMDL for FS2004? )


His response was that the MakeMDL developer would be asked.

I suspect the 1024 limitation was an arbitrary decision... made back in FS2002 or earlier. There probably is no real reason for it.

Dick
 
Hi Arno

sorry to be late (usual springtime skying) to thankyou for the code
managing the LSB of the float. That was the part I missed!

Your code is perfectly clear to me

Playing now with looooong animations!

Thank again
cheers
GianP
 
Dick, just for the record, I also contacted them. I know they know about this.... but I am sure that the priority is most likely FSX...
 
Hi Nick.

I also assume that a fix, if it is made, will be for FSX.

A clue here is that FSX will use a form of MakeMDL. ;)

Dick
 
Fantastic... this is exactly, what I wanted to ask. You're a genius, Arno!

I will definitely hang on to this one, as I really like to do some extensive car-traffic in FS9 und don't like my workaround (2 Cars following each other to simulate 108 seconds :( )

This tutorial, you talked about - have you ever completed it, arno? And if not, where should I begin with my studies on these issues? I assume - the ASM-Tweaking-Wiki, right?
 
Last edited:
Hi,

No, that tutorial was never really finished. But recently I got a request from somebody else to help and I will make sure I write a tutorial about that. I hope to finish it soon.
 
holiday.gif


Marvellous... you should get a flightsim award for your ideas!
 
Last edited:
Oh man... this is not good... I gave it many tries by exactly replacing the lines in my test.asm with the modified versions (leaving the real4-part untouched.) But after about 10 seconds (the animation really shows up and moves) the FS crashes to desktop or sometimes it freezes for some seconds and then crashes, sometimes only freezes to death, sometimes showing an error message about g3d.dll. If I modify the first value for the second key in the real4-part, the animation moves slower or faster (as expected) but crashes nevertheless. :(

Can you (or someone else, who can help) have a look on my ASM's please?

Thanks in advance,
 
Last edited by a moderator:
Hi,

I have to dive into this kind of code a bit more to give you a clear answer. I will do that (the diving into it :)) soon when I write a new article about it.

I think your crash could be related to the fact your table with animation keys has only 1023 frames, while you try to access higher frame numbers now.
 
Thanks again for helping me (I feel a little ashamed, because I come along and throw a thousand questions at you... Hope, it's not too much...
redface.gif
)

I think your crash could be related to the fact your table with animation keys has only 1023 frames, while you try to access higher frame numbers now.

No... I tested various variations: 0-10, 0-511, 0-1023, 0-04095 and values between them... nothing helped. I really get nervous, if the sourcecode works flawlass on your system... :confused:

Another info, that might be helpful. As long as the old variable test_1_tick18_mod_1 (is it a variable?) is active, nothing crashes (but the 1028-limit is active). At the moment, the new base (varbase) is used, the crashes occur. I implemented in the new code step-by-step, to hunt down the critical code.

Greetings,
Gerd
 
Last edited:
Thanks for this tip Arno, but this means that I should extend my animation also in GMax? I'm not sure about this. I would proceed in this way: in GMax create a potential veeery long animation (but with speed limitations due frame numbers), then export and hack the asm. correct?
 
Hi,

No, you can only export animation with maximum 1024 frames from GMax. So you would have to make the longer animation in the ASM code, possibly by adding different GMax animation tables together.
 
Hi,

No, you can only export animation with maximum 1024 frames from GMax. So you would have to make the longer animation in the ASM code, possibly by adding different GMax animation tables together.

Mmmhh, so what should I do? If I would move my objects around my runway, how to proceed since I've exporting frames number limitation?
 
Hi,

You would have to export it in pieces of 1024 frames from GMax and manually put them all together in one big animation table.
 
Back
Top