Users browsing this thread: 3 Guest(s)
Summoners War
#31
So I put in quite a bit of work trying to get animations ripped. For the most part, I've figured out the format, but some bytes are encrypted and I only have 1/5 of them solved, as of writing this. Basically the animation chunk goes as followed.

PLM Chunk:
  • 4 bytes String "PLM$"
  • 2 bytes > unknown_size_A anim_track_count
  • 20 bytes > some unknown value
  • anim_track_count * 7 bytes > the 6th byte 6th and 7th byte are a short for the maximum size of an animation track, which I put in track_size array
And right after bone data
I don't know how to explain the format without a bit of indentation, so here you go
  • Track (amount of tracks equal to anim_track_count)
    • 24 bytes unknown, possibly position values for UI elements
    • Bone data, amount equal to bone_count
      • Dynamic bytes > encrypted values that contain the amount of Quaternion keyframes.
      • quaternion_keyframe_count * 8 > quaternion values
      • Dynamic bytes > encrypted values that contain the amount of Position keyframes.
      • position_keyframe_count * 12 > position values
      • Dynamic bytes > encrypted values that contain the amount of Scale keyframes.
      • scale_keyframe_count * 12 > scale values
Dynamic bytes is equal to (int(ceil (track_size[current_track] / 8 + 1))), and if the first byte is 0x00 then dynamic bytes' size is 1 and keyframe count is 1.

The values of dynamic bytes are plugged into a 256 length array that outputs values 0 through 8, and these values are added together to get the final value for that bone's quaternion, position, or scale. (Scale seems to always be empty with the models I've checked)

Code:
FF FF FF FF FF FF FF FF FF FF 01    -- Quaternion keyframe count, 10 bytes of 8 and 1 byte of 1, adds to 81
EF 0C A6 6C C6 C9 A6 D9             -- Quaternion values (81 * 8 bytes)
EE 0C A7 6C C7 C9 A7 D9 
EB 0C AB 6C CC C9 AA D9 
...
EF 0C A6 6C C6 C9 A6 D9
00                                  -- position keyframe count (empty)
C7 4F 00 00 F4 40 00 00 4A 1D 00 00 -- position value
00                                  -- scale keyframe count (empty)
00 00 01 00 00 00 01 00 00 00 01 00 -- scale value

My current progress on the decryption array
Code:
decrypt_keyframe_size_value = #(
--  0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
   0, 1, 1, 2, 1, 1,  , 3, 1,  ,  ,  ,  , 3, 3, 4, -- 0x00
   1,  ,  ,  ,  , 2,  ,  ,  ,  ,  ,  ,  ,  ,  , 5, -- 0x10
   1, 2,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  , -- 0x20
    , 3,  ,  ,  ,  ,  ,  ,  , 4,  ,  ,  ,  ,  , 6, -- 0x30
   1, 2,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  , -- 0x40
   1,  ,  ,  ,  , 4,  ,  ,  ,  ,  ,  ,  ,  ,  , 6, -- 0x50
    ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  , -- 0x60
    ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  , 4,  ,  , 7, -- 0x70
   1, 2,  , 3,  , 4,  , 4,  ,  ,  ,  ,  ,  ,  , 5, -- 0x80
    ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  , 6, -- 0x90
    ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  , 6, -- 0xA0
    ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  , 6,  ,  ,  , 7, -- 0xB0
   2, 3,  ,  ,  ,  ,  , 5,  ,  ,  ,  ,  ,  ,  ,  , -- 0xC0
    ,  ,  ,  ,  , 5,  ,  ,  ,  ,  ,  ,  ,  ,  , 7, -- 0xD0
   3, 4, 5, 5,  ,  ,  , 6,  ,  ,  ,  ,  ,  ,  , 7, -- 0xE0
   4, 5,  ,  ,  , 6,  , 7, 5,  ,  , 7, 6, 7, 7, 8, -- 0xF0
Unfortunately I'm starting to find that some of these values are likely incorrect, and with this being such a tedious and very error-prone process where any mistake, if not caught early, will undo a ton of work, I need to know if there is a quicker way to get this array filled out with 100% accuracy.
Also, some of the values seem like they work for newer models, but not work for older ones, such as 0x1F as 5 works for newer ones, but 0x1F as 4 works for older ones. It's difficult to say if the newer models add 1 to the final number, the older ones subtract 1, or if there's a flag somewhere that tells the game to add or subtract... I don't know.

Edit: In regards to the existence of a flag that may add or subtract from the keyframe count, that might be true. With a couple files I've looked at that have been a pain in the neck in that regard, it looks like in the PLM$ area with the track info, the 1st byte's 2nd nibble is 0 for unaffected keyframe counts, and 8 for keyframe counts that subtract 1 to get the final result. I don't know yet if the first nibble has much relevance, as it's mostly C and in one example 4. This byte is also always the same for each track in the file.

Edit2: Okay, if there is a flag, what I pointed out is almost certainly not it.

Edit3: Confirmed because of Valkyrja transmog 3's idle animation having 361 frames, the 6th and 7th byte are 2 bytes frame count rather than one.
Reply
Thanked by:


Messages In This Thread
Summoners War - by aceres - 05-25-2015, 09:48 AM
RE: Summoners War - by TGE - 05-25-2015, 10:22 AM
RE: Summoners War - by aceres - 05-25-2015, 10:59 AM
RE: Summoners War - by kutaras - 05-25-2015, 11:02 AM
RE: Summoners War - by aceres - 05-25-2015, 11:04 AM
RE: Summoners War - by kutaras - 05-25-2015, 11:12 AM
RE: Summoners War - by aceres - 05-25-2015, 12:25 PM
RE: Summoners War - by kutaras - 05-25-2015, 12:36 PM
RE: Summoners War - by kutaras - 05-26-2015, 12:08 PM
RE: Summoners War - by aceres - 05-27-2015, 01:39 AM
RE: Summoners War - by kutaras - 05-27-2015, 07:47 AM
RE: Summoners War - by TGE - 05-27-2015, 08:50 AM
RE: Summoners War - by kutaras - 05-27-2015, 12:25 PM
RE: Summoners War - by CrankyCvnt - 03-24-2022, 12:44 AM
RE: Summoners War - by TGE - 05-27-2015, 03:45 PM
RE: Summoners War - by kutaras - 06-01-2015, 06:46 AM
RE: Summoners War - by aceres - 06-01-2015, 07:04 AM
RE: Summoners War - by kutaras - 07-09-2015, 07:12 AM
RE: Summoners War - by xHighx - 05-12-2016, 08:47 AM
RE: Summoners War - by TGE - 05-13-2016, 03:34 AM
RE: Summoners War - by xHighx - 05-13-2016, 12:02 PM
RE: Summoners War - by TGE - 05-25-2016, 06:51 AM
RE: Summoners War - by aceres - 10-21-2016, 03:41 PM
RE: Summoners War - by aceres - 10-28-2016, 07:04 AM
RE: Summoners War - by Carpaccio - 10-23-2016, 10:58 AM
RE: Summoners War - by aceres - 10-23-2016, 12:48 PM
RE: Summoners War - by aceres - 11-08-2016, 03:15 PM
RE: Summoners War - by aceres - 11-13-2016, 02:20 AM
RE: Summoners War - by aceres - 11-16-2016, 04:53 AM
RE: Summoners War - by aceres - 01-01-2017, 03:01 AM
RE: Summoners War - by aceres - 01-07-2017, 03:47 AM
RE: Summoners War - by TwiliChaos - 03-28-2018, 02:03 PM
RE: Summoners War - by TwiliChaos - 03-30-2018, 02:50 AM
RE: Summoners War - by TwiliChaos - 04-22-2018, 09:27 AM
RE: Summoners War - by NatoriousB - 09-09-2020, 01:00 PM
RE: Summoners War - by NatoriousB - 09-13-2020, 08:07 AM
RE: Summoners War - by RedBear - 09-13-2020, 08:07 AM
RE: Summoners War - by richenberg - 02-02-2021, 10:25 AM
RE: Summoners War - by RedBear - 02-04-2021, 11:22 AM
RE: Summoners War - by NatoriousB - 09-14-2020, 12:54 AM
RE: Summoners War - by richenberg - 02-22-2022, 07:46 AM
RE: Summoners War - by RedBear - 04-18-2022, 07:45 AM
RE: Summoners War - by Neostatos4 - 05-15-2023, 04:17 PM
RE: Summoners War - by andre.aguiar - 05-30-2023, 10:13 AM
RE: Summoners War - by Neostatos4 - 05-30-2023, 11:10 AM
RE: Summoners War - by andre.aguiar - 05-30-2023, 01:23 PM
RE: Summoners War - by RedBear - 06-24-2023, 12:45 PM
RE: Summoners War - by Neostatos4 - 06-26-2023, 11:57 PM
RE: Summoners War - by RedBear - 06-27-2023, 11:38 AM
RE: Summoners War - by andre.aguiar - 05-30-2023, 03:35 PM
RE: Summoners War - by Neostatos4 - 05-30-2023, 04:37 PM
RE: Summoners War - by andre.aguiar - 06-02-2023, 08:21 AM
RE: Summoners War - by Neostatos4 - 06-02-2023, 09:46 AM
RE: Summoners War - by Neostatos4 - 06-28-2023, 10:15 AM
RE: Summoners War - by RedBear - 06-29-2023, 10:16 AM
RE: Summoners War - by TwiliChaos - 11-24-2023, 08:30 PM
RE: Summoners War - by andre.aguiar - 04-24-2024, 07:46 AM
RE: Summoners War - by Dandy Cadet - 11-27-2023, 09:19 PM
RE: Summoners War - by endriu - 01-08-2024, 05:30 AM
RE: Summoners War - by RedBear - 04-02-2024, 12:07 AM
RE: Summoners War - by andre.aguiar - 04-26-2024, 09:34 AM

Forum Jump: