Page 2 of 2 FirstFirst 12
Results 21 to 38 of 38

Thread: 3ds Max CAS Importer patch for ALX

  1. #21

    Default Re: 3ds Max CAS Importer patch for ALX

    Played around with the script.

    Imports and exports units correctly, haven't had problems, but i admit, i tested just some random models.
    Tested sample animation for all infantry and cavalry units i had (signifierone's pack) - works.
    Don't know how to work with animatons, so i didn't export any
    Haven't tested items.

    When importing some models from vanilla (those with a number on their name like: officer_roman_standard_400) there are 4 things i have encountered till now:

    1. It warns about an older model and imports correctly (example: officer_roman_standard_400.cas).
    2. It does not warn and imports correctly (example: unit_greek_pike_phalanx_400.cas)
    3. It gives warning and imports, but stuff is missing (example: unit_greek_royal_cavalry_400.cas) Looks like the face of the body-model attached to the shoulders is missing. Even crazier - some of those moddels are used in the game and don't have missing parts (the example above is the model for the companion cavalry).
    3. As above, but also with a old type of texture by default so it looks really bad. But they still miss the shoulder stuff. Example: unit_greek_archer_400.cas

    don't have the time to go trough them all and separate the different cases, but i was wondering why do they miss their shoulders? Attaching the units as before. units.rar

  2. #22
    RedFox's Avatar When it's done.™
    Join Date
    Nov 2006
    Location
    Estonia
    Posts
    3,027

    Default Re: 3ds Max CAS Importer patch for ALX

    Made a significant breakthrough with siege engine animations. After looking at the HEX, I immediately became suspicious, because the siege engine animation looks nothing like unit animations. And of course, I also noticed a few hard-to-miss constants.

    So when I ran it with the C++ CasImporter, it loaded siege engine animations perfectly fine - as models.

    Yeah. Everything seems to actually make sense now. This is why there are animations in the BoneChunk of the CAS - because that is what a CAS model is supposed to be: a dynamic format that can contain any kind of data, really. As long as you know how to read a chunk, you can do it - otherwise you shouldn't care.

    So when animations are loaded in RTW, it opens a CAS file and only bothers with the BoneChunk(0). If you load a mesh however, it looks for BoneChunk(0), PropMesh(1), SkinMesh(2) and Textures(5).

    Chunks that aren't used are just empty, which leads to thinking that they are definitely used for some other data in the engine.


    Now the reason why animations fail? Because CA broke their CAS format in unit animations. Probably because regular CAS files have quite a lot of bloat and are difficult to parse. The unit animations only have a 5 byte header followed by animation data..


    What will all of this mean for animation import/export? It's easy to detect whether we're dealing with unit or engine animations, but saving needs to be explicit: "Export Unit Anims.." and "Export CAS Anims...".

  3. #23

    Default Re: 3ds Max CAS Importer patch for ALX

    great work again, Redfox!Now i can finish these patch

  4. #24
    Gen.jamesWolfe's Avatar Vicarius
    Join Date
    Jan 2008
    Location
    in my house.
    Posts
    2,610

    Default Re: 3ds Max CAS Importer patch for ALX

    So wait, how do we import the siege engine animations in the first place again?

    because I tried importing it as a model, as you have suggested, but did not succeed. unless you mean that this will be in a future patch?
    I haz a culler!! (really, who gives a darn? its totally meaningless, and it doesn't really accurately reflect who I am)


  5. #25
    RedFox's Avatar When it's done.™
    Join Date
    Nov 2006
    Location
    Estonia
    Posts
    3,027

    Default Re: 3ds Max CAS Importer patch for ALX

    Quote Originally Posted by Gen.jamesWolfe View Post
    So wait, how do we import the siege engine animations in the first place again?

    because I tried importing it as a model, as you have suggested, but did not succeed. unless you mean that this will be in a future patch?
    That's because the MaxScript version is very unstable. The C++ version included in a different zip can open up the siege engine animations though.

    The MaxScript version will need to be slowly updated to function like the C++ version. So yeah, that's something for a future release.

  6. #26
    Gen.jamesWolfe's Avatar Vicarius
    Join Date
    Jan 2008
    Location
    in my house.
    Posts
    2,610

    Default Re: 3ds Max CAS Importer patch for ALX

    Quote Originally Posted by RedFox View Post
    That's because the MaxScript version is very unstable. The C++ version included in a different zip can open up the siege engine animations though.

    The MaxScript version will need to be slowly updated to function like the C++ version. So yeah, that's something for a future release.
    that's good. I can use the c++ script in the meantime, till the future release comes. Once I (ineptly) figure out how. do I need to compile it, or something else?

    either way, thanks! I can finally make my vision for 18th century artillery come to pass!
    Last edited by Gen.jamesWolfe; July 23, 2013 at 01:26 AM.
    I haz a culler!! (really, who gives a darn? its totally meaningless, and it doesn't really accurately reflect who I am)


  7. #27
    Gen.jamesWolfe's Avatar Vicarius
    Join Date
    Jan 2008
    Location
    in my house.
    Posts
    2,610

    Default Re: 3ds Max CAS Importer patch for ALX

    Any news regarding the maxscript version of the siege engine friendly importer script? the C++ is proving most difficult at this time.

    till then, keep up the great work!
    I haz a culler!! (really, who gives a darn? its totally meaningless, and it doesn't really accurately reflect who I am)


  8. #28
    RedFox's Avatar When it's done.™
    Join Date
    Nov 2006
    Location
    Estonia
    Posts
    3,027

    Default Re: 3ds Max CAS Importer patch for ALX

    Since I had nothing better to do today, I figured I'd see if I can figure out the animations in CASImporter.

    I finally made a breakthrough, which also explains the mysterious zero-byte block in bone animations. Previously, based on Vercingetorix's work, a bone definition seemed to be like this:
    Code:
    [RTWBONE]
        [bone_name] // name of the bone
        [numFrames] // number of animation frames?
        [unknown??] // ?
        [...]
    Now, the CAS importer never really cared about what RTWBONE numFrames data told us and just blindly used the global NumFrames to read in the animations. This worked most times, but mysteriously failed other times. This is because the global NumFrames should not be relied on when reading bone animations.

    I discovered that a bone definition really looks like this:
    Code:
    [RTWBONE]
        [bone_name]          // name of the bone
        [rotation_frames]    // number of rotation animation frames for this bone
        [movement_frames] // number of movement animation frames for this bone
        [...]
    What this implies, is that when we read in animation data, we must first check if the bone actually has any rotation animation data and position rotation data.

    The animation data is laid out as:
    Code:
    [ANIMDATA]
        [num_bones]
        [unknown]
        [bone_hierarchy]
        [num_frames]
        [bone_data]       // RTWBONE definitions
        [rotation_anims] // rotation anims, based on each bone's rotation_frames
        [movement_anims] // movement anims, based on each bone's movement_frames
        [bone_positions] // default rig positions of bones

    This doesn't make much sense unless we view some actual bone definitions:
    Code:
           Scene Root           0f    0f    pos {  0.000,  0.000,  0.000 },
           bone_pelvis         65f   65f    pos {  0.000,  0.000,  0.000 },
           bone_RThigh         65f    0f    pos {  0.095,  0.001,  0.000 },
           bone_Rlowerleg      65f    0f    pos {  0.023, -0.465, -0.005 },
           bone_Rfoot          65f    0f    pos {  0.023, -0.401, -0.012 },
           bone_abs            65f    0f    pos { -0.000,  0.212,  0.000 },
           bone_torso          65f    0f    pos { -0.000,  0.212,  0.000 },
           bone_head           65f    0f    pos { -0.000,  0.235,  0.000 },
           bone_cloak_top      65f    0f    pos {  0.004, -0.084, -0.204 },
           bone_cloak_mid      65f    0f    pos {  0.000, -0.260, -0.070 },
           bone_cloak_bottom   65f    0f    pos {  0.000, -0.260, -0.070 },
           bone_Rupperarm      65f    0f    pos {  0.179,  0.078, -0.024 },
           bone_Relbow         65f    0f    pos {  0.302,  0.011, -0.014 },
           bone_Rhand          65f    0f    pos {  0.284, -0.003,  0.026 },
           bone_Lupperarm      65f    0f    pos { -0.178,  0.078, -0.024 },
           bone_Lelbow         65f    0f    pos { -0.302,  0.011, -0.014 },
           bone_Lhand          65f    0f    pos { -0.284, -0.003,  0.026 },
           bone_LThigh         65f    0f    pos { -0.095,  0.001,  0.000 },
           bone_Llowerleg      65f    0f    pos { -0.023, -0.465, -0.005 },
           bone_Lfoot          65f    0f    pos { -0.023, -0.401, -0.012 }
    What we can see from that data is that we have: 19 rotation anims, all 65 frames long;; 1 movement anim, 65 frames long.

    So the data is laid out as:
    Code:
    RotationsAnims[19 * 65f]
    MovementAnims[1 * 65f]
    This makes so much sense. If we open an ALEX model, we immediatelly notice something:
    Code:
           Scene Root           0f    0f    pos {  0.000,  0.000,  0.000 },
           bone_pelvis         68f   68f    pos {  0.000,  0.000,  0.000 },
           bone_RThigh         68f   68f    pos {  0.095,  0.001,  0.000 },
           bone_Rlowerleg      68f   68f    pos {  0.023, -0.465, -0.005 },
           bone_Rfoot          68f   68f    pos {  0.023, -0.401, -0.012 },
           bone_abs            68f   68f    pos { -0.000,  0.212,  0.000 },
           bone_torso          68f   68f    pos { -0.000,  0.212,  0.000 },
           bone_head           68f   68f    pos { -0.000,  0.235,  0.000 },
           bone_cloak_top      68f   68f    pos {  0.004, -0.084, -0.204 },
           bone_cloak_mid      68f   68f    pos {  0.000, -0.260, -0.070 },
           bone_cloak_bottom   68f   68f    pos {  0.000, -0.260, -0.070 },
           bone_Rupperarm      68f   68f    pos {  0.179,  0.078, -0.024 },
           bone_Relbow         68f   68f    pos {  0.302,  0.011, -0.014 },
           bone_Rhand          68f   68f    pos {  0.284, -0.003,  0.026 },
           bone_Lupperarm      68f   68f    pos { -0.178,  0.078, -0.024 },
           bone_Lelbow         68f   68f    pos { -0.302,  0.011, -0.014 },
           bone_Lhand          68f   68f    pos { -0.284, -0.003,  0.026 },
           bone_LThigh         68f   68f    pos { -0.095,  0.001,  0.000 },
           bone_Llowerleg      68f   68f    pos { -0.023, -0.465, -0.005 },
           bone_Lfoot          68f   68f    pos { -0.023, -0.401, -0.012 }
    Weird right? We have 19 rotation anims and 19 movement anims. The data is laid out as:
    Code:
    RotationsAnims[19 * 68f]
    MovementAnims[19 * 68f]
    And where does the movement anims section end? Exactly where the [bone_positions] section begins. For some reason the exporter they used for the ALEX expansion, also added movement animation data, even though there was no actual animation data stored. This perfectly explains the null bytes.


    Now that I can reliably parse animation data, I can begin working on the MaxScript version to work correctly. Right now the old MaxScript just assumes we always have 19 rotation anims and 1 movement anim, which is incorrect and also the reason why the script crashes..
    Last edited by RedFox; August 06, 2013 at 09:01 AM.

  9. #29
    Gen.jamesWolfe's Avatar Vicarius
    Join Date
    Jan 2008
    Location
    in my house.
    Posts
    2,610

    Default Re: 3ds Max CAS Importer patch for ALX

    Quote Originally Posted by RedFox View Post
    Since I had nothing better to do today, I figured I'd see if I can figure out the animations in CASImporter.

    I finally made a breakthrough, which also explains the mysterious zero-byte block in bone animations. Previously, based on Vercingetorix's work, a bone definition seemed to be like this:
    Code:
    [RTWBONE]
        [bone_name] // name of the bone
        [numFrames] // number of animation frames?
        [unknown??] // ?
        [...]
    Now, the CAS importer never really cared about what RTWBONE numFrames data told us and just blindly used the global NumFrames to read in the animations. This worked most times, but mysteriously failed other times. This is because the global NumFrames should not be relied on when reading bone animations.

    I discovered that a bone definition really looks like this:
    Code:
    [RTWBONE]
        [bone_name]          // name of the bone
        [rotation_frames]    // number of rotation animation frames for this bone
        [movement_frames] // number of movement animation frames for this bone
        [...]
    What this implies, is that when we read in animation data, we must first check if the bone actually has any rotation animation data and position rotation data.

    The animation data is laid out as:
    Code:
    [ANIMDATA]
        [num_bones]
        [unknown]
        [bone_hierarchy]
        [num_frames]
        [bone_data]       // RTWBONE definitions
        [rotation_anims] // rotation anims, based on each bone's rotation_frames
        [movement_anims] // movement anims, based on each bone's movement_frames
        [bone_positions] // default rig positions of bones

    This doesn't make much sense unless we view some actual bone definitions:
    Code:
           Scene Root           0f    0f    pos {  0.000,  0.000,  0.000 },
           bone_pelvis         65f   65f    pos {  0.000,  0.000,  0.000 },
           bone_RThigh         65f    0f    pos {  0.095,  0.001,  0.000 },
           bone_Rlowerleg      65f    0f    pos {  0.023, -0.465, -0.005 },
           bone_Rfoot          65f    0f    pos {  0.023, -0.401, -0.012 },
           bone_abs            65f    0f    pos { -0.000,  0.212,  0.000 },
           bone_torso          65f    0f    pos { -0.000,  0.212,  0.000 },
           bone_head           65f    0f    pos { -0.000,  0.235,  0.000 },
           bone_cloak_top      65f    0f    pos {  0.004, -0.084, -0.204 },
           bone_cloak_mid      65f    0f    pos {  0.000, -0.260, -0.070 },
           bone_cloak_bottom   65f    0f    pos {  0.000, -0.260, -0.070 },
           bone_Rupperarm      65f    0f    pos {  0.179,  0.078, -0.024 },
           bone_Relbow         65f    0f    pos {  0.302,  0.011, -0.014 },
           bone_Rhand          65f    0f    pos {  0.284, -0.003,  0.026 },
           bone_Lupperarm      65f    0f    pos { -0.178,  0.078, -0.024 },
           bone_Lelbow         65f    0f    pos { -0.302,  0.011, -0.014 },
           bone_Lhand          65f    0f    pos { -0.284, -0.003,  0.026 },
           bone_LThigh         65f    0f    pos { -0.095,  0.001,  0.000 },
           bone_Llowerleg      65f    0f    pos { -0.023, -0.465, -0.005 },
           bone_Lfoot          65f    0f    pos { -0.023, -0.401, -0.012 }
    What we can see from that data is that we have: 19 rotation anims, all 65 frames long;; 1 movement anim, 65 frames long.

    So the data is laid out as:
    Code:
    RotationsAnims[19 * 65f]
    MovementAnims[1 * 65f]
    This makes so much sense. If we open an ALEX model, we immediatelly notice something:
    Code:
           Scene Root           0f    0f    pos {  0.000,  0.000,  0.000 },
           bone_pelvis         68f   68f    pos {  0.000,  0.000,  0.000 },
           bone_RThigh         68f   68f    pos {  0.095,  0.001,  0.000 },
           bone_Rlowerleg      68f   68f    pos {  0.023, -0.465, -0.005 },
           bone_Rfoot          68f   68f    pos {  0.023, -0.401, -0.012 },
           bone_abs            68f   68f    pos { -0.000,  0.212,  0.000 },
           bone_torso          68f   68f    pos { -0.000,  0.212,  0.000 },
           bone_head           68f   68f    pos { -0.000,  0.235,  0.000 },
           bone_cloak_top      68f   68f    pos {  0.004, -0.084, -0.204 },
           bone_cloak_mid      68f   68f    pos {  0.000, -0.260, -0.070 },
           bone_cloak_bottom   68f   68f    pos {  0.000, -0.260, -0.070 },
           bone_Rupperarm      68f   68f    pos {  0.179,  0.078, -0.024 },
           bone_Relbow         68f   68f    pos {  0.302,  0.011, -0.014 },
           bone_Rhand          68f   68f    pos {  0.284, -0.003,  0.026 },
           bone_Lupperarm      68f   68f    pos { -0.178,  0.078, -0.024 },
           bone_Lelbow         68f   68f    pos { -0.302,  0.011, -0.014 },
           bone_Lhand          68f   68f    pos { -0.284, -0.003,  0.026 },
           bone_LThigh         68f   68f    pos { -0.095,  0.001,  0.000 },
           bone_Llowerleg      68f   68f    pos { -0.023, -0.465, -0.005 },
           bone_Lfoot          68f   68f    pos { -0.023, -0.401, -0.012 }
    Weird right? We have 19 rotation anims and 19 movement anims. The data is laid out as:
    Code:
    RotationsAnims[19 * 68f]
    MovementAnims[19 * 68f]
    And where does the movement anims section end? Exactly where the [bone_positions] section begins. For some reason the exporter they used for the ALEX expansion, also added movement animation data, even though there was no actual animation data stored. This perfectly explains the null bytes.


    Now that I can reliably parse animation data, I can begin working on the MaxScript version to work correctly. Right now the old MaxScript just assumes we always have 19 rotation anims and 1 movement anim, which is incorrect and also the reason why the script crashes..
    Great news!

    One thing though: if I gave a movement modifier to a separate bone from Bone Pelvis, would it be possible to create (conceivably) a skeleton with two separate section? say the limber for a gun, and gun proper. if so, this would be most useful.

    In addition, would this next version have the siege engine things fixed for the max-script version? the C++ is proving a headache to work with on my platform: compatibility issues.

    EDIT: forget the second part. just realized the discovery implies that it will XD
    Last edited by Gen.jamesWolfe; August 06, 2013 at 11:18 PM.
    I haz a culler!! (really, who gives a darn? its totally meaningless, and it doesn't really accurately reflect who I am)


  10. #30
    Gen.jamesWolfe's Avatar Vicarius
    Join Date
    Jan 2008
    Location
    in my house.
    Posts
    2,610

    Default Re: 3ds Max CAS Importer patch for ALX

    any further news or updates on the CAS script?
    I haz a culler!! (really, who gives a darn? its totally meaningless, and it doesn't really accurately reflect who I am)


  11. #31

    Default Re: 3ds Max CAS Importer patch for ALX

    I am also waiting for further news..

  12. #32

    Default Re: 3ds Max CAS Importer patch for ALX

    excuse my ignorance, as these files are installed? also works for files MIITW? and solve the problem of incopatibilidad with 3dmax 2012?

  13. #33
    Gen.jamesWolfe's Avatar Vicarius
    Join Date
    Jan 2008
    Location
    in my house.
    Posts
    2,610

    Default Re: 3ds Max CAS Importer patch for ALX

    any news on this?
    I haz a culler!! (really, who gives a darn? its totally meaningless, and it doesn't really accurately reflect who I am)


  14. #34

    Default Re: 3ds Max CAS Importer patch for ALX

    Maybe it is not place for it but I do have a question. Everything is fine when I import .CAS files. But unfortunately when i try to export it again to .CAS i'm getting error that 'scene root' needs validation. I'm new so is it my fault or something is broken? I'm using 3ds max 2013.

  15. #35

    Default Re: 3ds Max CAS Importer patch for ALX

    Hy guy, Ibrahim zallum ask me about cas model of rometw, i already did the Maxscript to open its but tested only for Medieval2 version:
    http://www.twcenter.net/forums/showt...n-of-GOAT-tool


    inside it you will find also the "Cas.bt" template, is a script of 010Editor, a binary viewer and editor. I don't know if you have already found the file structure, but if you want you can take a look about this file. If you can update its format please tell me, because i will update the 3dstudio script to work also with rome's files
    Forums:............freeforumzone - mtwitalia - twcenter
    Works:.....worldcollision file - ModelReferencePoints files - MaxScript Building Editor
    Other:.............siege-engine(video) - new-animations(video) - buildings
    Have to take the money where it is: at the poor. They have little, but they are many. Alphonse Allais

  16. #36

    Default Re: 3ds Max CAS Importer patch for ALX

    Does this script works with 3Ds Max Autodesk 2014? Because I extracted the .ms into my scripts folder, launched 3Ds and ran the script, but nothing happened.

    Just started learning modelization, any idea?

    Edit: Nevermind, found it.
    Last edited by Nelduin; May 23, 2014 at 07:44 AM.

    Mundus Bellicus - TWC - ModDB - Discord - Steam
    ~ Patronized by Gaius Baltar, son of the Great Family of imb39, of the House of Garbarsardar, of the Noble House of Wilpuri.

  17. #37
    Sinuhet's Avatar Preparing for death
    Join Date
    Mar 2005
    Location
    the Czech republic, EU
    Posts
    1,090

    Default Re: 3ds Max CAS Importer patch for ALX

    An impressive research. Very nice, thanks
    My TW games "Battle Formations" projects:
    Sinuhet's ETW Formations v2.0 – for ETW
    Sinuhet's Battle Mechanics v5.0 – for MTW2
    Sinuhet's Battle Mechanics v3.0 – for MTW2
    Sinuhet's AI Battle Formations v7.0 – for RTW 1.5


    In Patrocinivm Svb HorseArcher

  18. #38
    Relentless Hunter 7's Avatar Libertus
    Join Date
    Oct 2012
    Location
    My personal Paradice.....What?
    Posts
    50

    Default Re: 3ds Max CAS Importer patch for ALX

    Very impressive. This could be the answer to my problem with replacing RTW Parthia with ALX Persia. See here if you like: http://www.twcenter.net/forums/showt...in-vanilla-RTW

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •