Dead Space Animations (.BNK) and skeletons (.RCB)

Skeletons, animations, shaders, texturing, converting, fixing and anything else related to read game models
MaZTeR
Posts: 61
Joined: Sun Jun 05, 2016 1:30 pm

Dead Space Animations (.BNK) and skeletons (.RCB)

Post by MaZTeR »

I already made a thread to this forum about this case a while back but it appears I posted it to the wrong category. Well, I think this is the right place to ask for this.

I also asked about this on Xentax and so far only have gotten one answer, but nothing that really helps in decrypting this stuff.

I'll copy and paste everything I put to this thread on Xentax to here:


Hello, I already made a thread about this to this sub-category in this forum and in the video section, but there really hasn't been any progress on the animations, other than the models, so I decided to just make a new one here.

I've been working on fixing some of the rigs of the models and I've finished doing quite a lot of them. Here are few of them:
https://*SPAM*/_MaZ_TeR_/collect ... ecromorphs

As for the sake of cracking open the .BNK animation format, I'm going to include the Regenerator type Necromorph. There are three of them but they all use the same animations and sounds.

Here are three enemies that use these animations, they are rigged by me but they do not have correct bone IDs and have most likely incorrect weights:
https://*SPAM*/models/5dfe049b70 ... 2c6f315dae
https://*SPAM*/models/41661dda6f ... 6d3f770c45
https://*SPAM*/models/8d1acae1db ... 645b474980

The Dead Space 3 variant is not in t-pose because I accidentally rigged it out of it. However, the Ubermorph and the Hunter are in T-pose.

The skeleton is included with that model, naturally. However, the bone names are definitely different than to what Visceral Games set them as.

I forgot to switch the scene on 3D max when I was setting the pose of it so it's stuck like that, but as far as I know, it doesn't really matter how the model is posed as the animations will readjust the bones anyways.

Here are the animation files (.BNK) and presumably collision data (.HKX) of this NPC, which I think is useless if you just want the animations:
https://www.dropbox.com/s/gl6vw54pnjl1s ... d.rar?dl=0

There are 8 animations for this enemy:

- Attack
- Death
- Hit react
- Locomotive (Apparently these are the walking/running and in general, animations when the creatures move, the animation state name when looked at on Notepad point at the same direction)
- "Paired" (I have no idea what this is)
- "Scripted" (looking at it on Notepad, this seemed to be the animation when the creature hops in and out of a ventilation shaft and also might be the death animation when the player has critical health)
- "Unique" (No clue what this is)
- "Override" (I have no idea what this is as well)

They are all encrypted in .win format, like the bones.

Here is the bone script I use to get the skeletons, it's quite broken and only gives "red" weights to each bone and does not import the proper bone IDs:
https://www.dropbox.com/s/v340d9yzsij2g ... es.ms?dl=0

Here's the batch version of the model script I use (it doesn't import LODs):
https://www.dropbox.com/s/rtrof1xjrraw2 ... ch.ms?dl=0

Here's another version of the batch script that opens up LODs but it doesn't open up multiple .geo files in a folder like the one above and also breaks the LODs' and level meshes' UVs:
https://www.dropbox.com/s/n4lyc37w04u3w ... -3.ms?dl=0

Here's the content of the attack animation opened on Notepad:
https://www.dropbox.com/s/9wuywsrzv5pej ... k.txt?dl=0

Here is the unconverted skeleton (.RCB.win) of the model I have linked:
https://www.dropbox.com/s/v60xx8v92ce0a ... b.win?dl=0

Here's the content of the file opened on Notepad:

Code: Select all

     F:ã²               l      „                    €?    ´     ¼                  ð          ø  ftµ|  3   „   À  €  ÿÿÿÿÿÿÿÿÿÿÿÿ       ÿÿÿÿÿÿÿÿ       ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ         ÿÿÿÿÿÿÿÿ   
   ÿÿÿÿÿÿÿÿ       ÿÿÿÿÿÿÿÿ       ÿÿÿÿÿÿÿÿ       ÿÿÿÿÿÿÿÿ   
   ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿ       ÿÿÿÿÿÿÿÿ   !   ÿÿÿÿÿÿÿÿ   !   ÿÿÿÿÿÿÿÿ   "   ÿÿÿÿÿÿÿÿ   #   ÿÿÿÿÿÿÿÿ   $   ÿÿÿÿÿÿÿÿ   %   ÿÿÿÿÿÿÿÿ   &   ÿÿÿÿÿÿÿÿ   (   ÿÿÿÿÿÿÿÿ   )   ÿÿÿÿÿÿÿÿ   )   ÿÿÿÿÿÿÿÿ   )   ÿÿÿÿÿÿÿÿ   +   ÿÿÿÿÿÿÿÿ   ,   ÿÿÿÿÿÿÿÿ   0   ÿÿÿÿÿÿÿÿ   ____________  €?                  €?                  €?                  €?  €?                  €?                  €?       €°œ¿ Ó=  €?  €?                  €?                  €?                  €?›ý?• <        • ¼›ý?                  €?    d×3<|®œ¿ÃÁÕ=  €?ìõ?Ï]ʺˆ<      @¡?^J´=    T¬¼EC´½†÷~?    VtíºJ>¿“ »  €?^Ê?ÌÖ8<=    _Š9¼Æû?pOg:    ~ ½97­º„Î?    é"î½ “¿ôÎw=  €?ÞÔ?   AÅ;w†½    ,lÄ»Íþ?gV:    ïŠ=糺Ö?    åD >0¸’¿ì—y=  €?t:?ÌÓ‹=õñ=    ³}½æ
?‡dK=    :€½üZU½•‚?    Ž=St¯¿VD=  €?  €?ÄH´·ˆ´    &Ã.§²Àb¿¦í>    JYš´¦í¾²Àb¿    ×Óu³Š®ˆ?}ÜH¿  €?Œû¿Ö   ¼ä/¼      Ø%11¿Ä8?    ú>¼ÜÀ8?x.1?    ÄIÜ=ú®?#D¿  €?Œû¿ÀÙ   <ç4<      0¦21¿Ã8?    A ?<ã¿8?{/1?    ÓIܽµ¯?ÄB¿  €?"Èd¼^Ê?%}=    ,`¿_Š9¼¡ ½    ±
Œ½~ ½   5?    »{)?zd¾p¶;  €?~f»ÞÔ?gã½    åb¿,lÄ»¾0½    mŠ½ïŠ=>9?    bà(?~
>µ˜™;  €?+K~?ÌÓ‹=l3¾=    éû”½æ
?»í:=    ð·½üZU½. ~?    —¬Ð=>J¿ƒé<  €?Aÿ¿´’Ž»q¢ÿº     ÀZ¨bmѾ¿ši?    Ð=œ»ši?ÆlÑ>    ·Ûë=‹å>ºœ¿  €?‡–¿âNT=‚¼<      ’§É¿Ï¾’úi?    0Jh=+ši?1jÏ>    Cõ½æ>æú›¿  €?›ý?— <‡P1    — ¼›ý?½èÍ®    ª+P±÷”.  €?    a¾6¿9¾÷ø »  €?^Ê?ÌÖ8<=    _Š9¼Æû?pOg:    ~ ½97­º„Î?    Q¾öÕ¾å«=  €?›ý?— <µ   Q1    — ¼›ý?(äÊ.    àùP±   ¯  €?    ëN>77¾àø »  €?H½~?-¬¨½þáa=    Ýmª=¿?n*\¼    ¯‹\½²"“<X–?    Ï¡¾BˆÒ¿,&Å=  €?î÷¿¯f<Åã;      ']â¾®°e?    ō€<q©e?=â>    cÇÝ=ʬb>[K›¿  €?Aÿ¿´’Ž»q¢ÿº     @Z¨bmѾ¿ši?    Ð=œ»ši?ÆlÑ>    ·Ûë=궚>ºœ¿  €?÷ü¿w
<ÀF‹;     Ø )x⾧°e?    ³´<î­e?Êâ>    IÕ½‡²e>‚=›¿  €?‡–¿âNT=‚¼<     €‘§É¿Ï¾’úi?    0Jh=+ši?1jÏ>    Cõ½ìS›>æú›¿  €?‰Eu¿X‘¾¯&=    • 1>&   >‡±}?    Úª’¾Ïs?Úf¾    Î@>Ižœ½ÝÕú¼  €?^Ê?ÌÖ8<=    _Š9¼Æû?pOg:    ~ ½97­º„Î?    ;á!¾ª†¾Ž>  €?&ä~¿Æ1¾=P;    Ü1 ¯@½r·?    ½g¾=é›~?fÙ?=    ¬Ê¾’­Ç½¬?½  €?÷?ý%G?Oøò½      ¦za>í}?    ssI?F)¿†¾=    Co½羆Ðé¿  €?  €?ÖE÷&ª±'     Úž&*Z?òð¿     æ·§òð?*Z?    }²l9üæÅ¿}?  €?“÷?ý%G¿ýôò=      B¦j_>}?    csI¿g)¿ƒ¾=    ‡“=2þðÎé¿  €?^Ê?ÌÖ8<=    _Š9¼Æû?pOg:    ~ ½97­º„Î?    r»§½oL̽`Æ >  €?øáV>âq?]Ɔ¾      $؉>4Œv?    ÍLz?ÔòN¾™hg=    {Yš=â9¿jà¿  €?  €?F×~'8bŠ'    €Ûž&uÕ?C´Q¿    àæ·§C´Q?uÕ?    }²l9ìŏ¿1GÈ?  €?/âV>Øq¿‘Ɔ>      6&J؉>-Œv?    ÊLz¿óN¾0ig=    µ'š½þ9¿.fà¿  €?½|?\$
>YÌ¢=    ÷]¤½  Ç'˜,?    ί >{Ž}¿3>5<    ”ª¾à+…¾… À  €?øáV>âq?]Ɔ¾      $؉>4Œv?    ÍLz?ÔòN¾™hg=    {Yš=â9¿jà¿  €?  €?Üì²'™Dè&     Úž&¥yÈ=BÅ~¿    Èæ·§BÅ~?¥yÈ=    }²l9µ•¾]ˆù?  €?½|¿í$
>éË¢½    Š]¤½  P¦™,?    _° >vŽ}?t>5<    •Îª¾34…>º… À  €?/âV>Øq¿‘Ɔ>      4&J؉>-Œv?    ÊLz¿óN¾0ig=    µ'š½þ9¿.fà¿  €?[J
¾5q?šLœ>     ÿ¢+ϝ¾c‰s?    )}?gi>´1.=    Ø@…>6bä¾ÈÜ
À  €?øáV>âq?]Ɔ¾      $؉>4Œv?    ÍLz?ÔòN¾™hg=    {Yš=ü~O¿jà¿  €?  €? ¡¦ À·'     Úž&  €?  Š&    Éæ·§  Š¦  €?    }²l9¢Òû¿ö@¾  €?J
¾5q¿™Lœ¾     n<«ϝ¾c‰s?    +}¿+i>c1.=    ºH…¾X™ä¾ß
À  €?/âV>Øq¿‘Ɔ>      4&J؉>-Œv?    ÊLz¿óN¾0ig=    µ'š½
›O¿.fà¿  €?øáV>âq?]Ɔ¾      $؉>4Œv?    ÍLz?ÔòN¾™hg=    {Yš=óe¿jà¿  €?  €? ¡¦ À·'      Ÿ&  €?  &    Éæ·§  Š¦  €?    ¬Ü"=Låü¿.dŽ¾  €?  €? ¡¦ À·'     €ž&  €?  Œ&    Éæ·§  Š¦  €?    =!½Båü¿0dŽ¾  €?µ¾8?\Y¿à›¾       %’   à¾Ú0f?    %71¿˜&¿Ç­¡¾    6ce>‚¶„?ºÌ¿  €?/âV>Øq¿‘Ɔ>      6&J؉>-Œv?    ÊLz¿óN¾0ig=    µ'š½8e¿.fà¿  €?øáV>âq?]Ɔ¾      $؉>4Œv?    ÍLz?ÔòN¾™hg=    {Yš=ê¸z¿jà¿  €?/âV>Øq¿‘Ɔ>      6&J؉>-Œv?    ÊLz¿óN¾0ig=    µ'š½ýÔz¿.fà¿  €?ähú            !   Š!W               ¸X               %
§               Þô_               {®            +   |®            0   }®            2   évD               Ìm               Ò!               }               $¬~"               ß/ò/               cIµ5               Lv7               —æÅ9               Ûñ<            /   ÛóQ           
   4ƒR               ”7U                eˆ]               ¥Kd            *   ü1áf               1±q            '    Îø~            )   «Åœƒ               éÓ»ƒ               5d8†               Êù臠           -   ‹1¦            "   Õ)Ü¢            &   åÔ¥               æÔ¥                èÔ¥            $   ”•õ©                  š,÷®           
   æ<S¯               ìÓT´               ¿®µ            %   ¬tÀ               XÓà           (   XÓà           ,   XÓà           1   Ák,Ó               n5ÿÖ               vyëë               Ä¿^ð            .   [VÛó            #   >ò
õ               A4ü               zombie _ù€íW”  ¿±£¤  œ  3   ÿÿÿÿÿÿ ¬  3              ¼  ñGõ›ëK)Œäލ3få»$ÇáýêtËîA%{Á­m²­ ¡ðsýˆÏ____              JLþÏü  ¸  ¤  ”    ˆ  €   |   x   p   h   \   H   @   $          


There are some lines missing from the previews but you can find the actual animation and skeleton files above.

This is the skeleton (.RCB) script:

Code: Select all

fname = GetOpenFileName caption:"Dead Space Skeleton" types:"(*.rcb.win)|*.rcb.win"
If (fname!=undefined) and ((DoesFileExist fname)==true) then (--)
g = fopen fname "rb"   --open file in read only format
clearlistener()
fscale=100
-- delete $*

fn ReadFixedString bstream fixedLen = (
   local str = ""
   for i = 1 to fixedLen do
   (
      str += bit.intAsChar (ReadByte bstream #unsigned)
   )
   str
)
fn GetName bstream Offset = (
   fseek bstream Offset #seek_set
   MeshName = readstring bstream
   return MeshName
)

BoneNameOffset=#()
BoneNameLength=#()
BoneName=#()
BoneParentID_Array=#()
BoneArrayNameOffset=#()
BoneName=#()
BoneCount=#()
BoneIDTable=#()
BoneStart=#()

FileLength = readlong g
ukw =readlong g   --always 0x1a
ukw2 = readlong g
fseek g 0xc #seek_cur

SkelCount = readlong g   -- always 1, prob count
DataOffset = readlong g
ukw4 = readlong g   -- same as ukw 3
DataOffset2 = readlong g
fseek g 0x10 #seek_cur
ukw5 = readlong g
ukw6 = readlong g   -- same as ukw 4 and 3
DataOffset3 = readlong g

fseek g DataOffset #seek_set

for x=1 to SkelCount do (
   ukw7 = readlong g
   BoneArrayNameOffset[x] = readlong g
   BoneCount[x] = readlong g
   BoneIDTable[x] = readlong g
   BoneStart[x] = readlong g
   ukwtableoffset = readlong g
   
   Print ("BoneStart @ 0x"+((bit.intAsHex(BoneStart[x]))as string))
   Print ("BoneCount @ 0x"+((bit.intAsHex(BoneCount[x]))as string))

)

for x=1 to SkelCount do (
   BoneName[x] = GetName g BoneArrayNameOffset[x]
   print BoneName[x]
)


For x=1 to SkelCount do (
   BoneParentID=#()

   fseek g BoneIDTable[x] #seek_set
   For y=1 to BoneCount[x] do (
      BoneParentID[y] = Readlong g + 1
      fseek g 0xc #seek_cur
   )
   BoneParentID_Array[x] = BoneParentID
)

For x=1 to SkelCount do (
   fseek g bonestart[x] #seek_set
   
   BoneColor = random black white

   BNArr = #()
   for y=1 to BoneCount[x] do (
     
      m11 = readfloat g; m12 = readfloat g; m13 = readfloat g; m14 = readfloat g
      m21 = readfloat g; m22 = readfloat g; m23 = readfloat g; m24 = readfloat g
      m31 = readfloat g; m32 = readfloat g; m33 = readfloat g; m34 = readfloat g
      m41 = readfloat g; m42 = readfloat g; m43 = readfloat g; m44 = readfloat g
      tfm = matrix3 [m11,m21,m31,m41] [m12,m22,m32,m42] [m13,m23,m33,m43] [m14,m24,m34,m44]   
     
      newBone = bonesys.createbone   \
      tfm.row4   \
      (tfm.row4 + 0.01 * (normalize tfm.row1)) \
      (normalize tfm.row3)
      newBone.width = 0.1
      newBone.height = 0.1
      If SkelCount == 1 then newBone.wirecolor = yellow
      Else newBone.wirecolor = BoneColor
     
      newbone.showlinks = true
      newBone.transform = inverse tfm

     
      pos = [m41,m42,m43]
      pos = pos * tfm

      newBone.pos.x += ((fscale)*pos.x)
      newBone.pos.y += (-1*(fscale)*pos.z)
      newBone.pos.z += (-1*(fscale)*pos.y)   

      newBone.setBoneEnable false 0
      newBone.pos.controller = TCB_position ()
      newBone.rotation.controller = TCB_rotation ()
     
     
      if (BoneParentID_Array[x][y] != 0) then (
      newBone.parent = BNArr[BoneParentID_Array[x][y]]
      )
      else (
         newbone.name = BoneName[x]
      )
      append BNArr newBone
   )
)




select $*
deselect $*

Print ("Last Read @ 0x"+((bit.intAsHex(ftell g))as string))
)

gc()
fclose g


I really hope these could be sorted out some day. These games are quite old so you'd think there was a tool with some modifications done to them can open these. The skeletons can be extracted but the weights are wrong and need to be reset and the bone names are not correct either. So far I have had to re-rig all the skeletons which has taken quite a long time and isn't perfect, but I don't think I should be doing that as they are already ready and just that script has to be fixed.