Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Madagascar: Escape 2 Africa (PS2/PS3/Wii/Xbox/PC) bld help?

Featured Replies

  • Author
  • Localization

Linus, posted Wed Feb 07, 2018 7:44 pm (32266)


Hello! I'm looking for a script that can extract the bld archive files in the Wii version of Madagascar: Escape 2 Africa. I saw a script on The PS23D Format Wiki, but it is no longer available because the wiki's subscription expired. Does anyone happen to have a script that can extract models and stuff from these bld files? Or can somebody write one? Here is the bld file: https://mega.nz/#!83I3VDQT!g9ond4NkCLkk ... wl_K5CYg8M . I see alot of directories and filenames that reference model (.mdl) and animation (.ma) files, along with specific vertex group names.
  • Author
  • Localization

Acewell, posted Tue Feb 13, 2018 1:32 am (32427)


this bms script will split the files from bld sample :D
Code:
# script for QuickBMS http://aluigi.altervista.org/quickbms.htm

idstring "IGA\x1a"
get VERSION long
get DIR_LENGTH long
get FILES long
get UNK long
get UNK2 long
get STR_TABLE_OFF long
get STR_TABLE_SZ long
getdstring SKIP 16
for i = 1 to FILES
   get HASH[i] long
next i
for i = 1 to FILES
   get OFFSET[i] long
   get SIZE[i] long
   get FF_BYTES long
next i
goto STR_TABLE_OFF
for i = 1 to FILES
   get REL_STR_OFFSET long
   math REL_STR_OFFSET STR_TABLE_OFF
   savepos TMP
   goto REL_STR_OFFSET
   get NAME[i] string
   log NAME[i] OFFSET[i] SIZE[i]
   goto TMP
next i

i just formed this specs into a script :)
http://wiki.xentax.com/index.php/Madaga ... e_2_Africa
i guess you'll need another script for the extracted files, i have not looked at them yet though. :)
  • Author
  • Localization

Linus, posted Tue Feb 13, 2018 11:50 pm (32452)


Thank you for the script! It extracted a file called "level.bld". This seems to be a different type of bld file, as the script you made does not work with it. I'm fairly certain the stage and/or character models are stored in this file. Once again, I saw a link on PS23DFormat wiki to a script that converts bld models to 3ds models, but as I said before, anything on that wiki is inaccessible. If possible, can you make or find the script that converts these? Here is the "level.bld" file: https://mega.nz/#!Ej4ADS4R!Zj9CxzdwtBn2 ... 5peSx9zTZs
  • Author
  • Localization

Acewell, posted Wed Feb 14, 2018 2:54 am (32453)


your samples up to this point have been archives, this thread would've got more attention in the "Game Archive" section i think. :)
anyway the new bld sample looks like a stream of zlib compressed chunks with 0x800(?) padding but the file ends abruptly for some reason. :D
i don't know anything about this game's models, you'll have to contact the owner of that wiki for the conversion scripts.

edit
this bms script will decompress those zlib streams in your new bld sample :D
Code:
# script for QuickBMS http://aluigi.altervista.org/quickbms.htm

endian big
comtype zlib_dynamic
get BLD_SIZE asize
for i
   get NAME basename
   string NAME _decmp.bld
   get ZSIZE short
   savepos OFFSET
   append
   clog NAME OFFSET ZSIZE ZSIZE
   append
   math OFFSET ZSIZE
   goto OFFSET
   if OFFSET >= BLD_SIZE
      break
   else
      do
         get CHECK byte
      while CHECK == 0
      goto -1 0 seek_cur
   endif
next i
  • Author
  • Localization

episoder, posted Fri Feb 16, 2018 3:50 am (32487)


certainly. what is it that you want? models and textures?

-snip-
  • Author
  • Localization

Linus, posted Fri Feb 16, 2018 4:32 am (32488)


Thanks! I'm looking for models though, can you make/find a script that can extract them? I see a lot of 3d model-related variables and whatnot in the file (such as shaders, materials, etc).
  • Author
  • Localization

episoder, posted Fri Feb 16, 2018 4:36 am (32489)


yeh. there's a ton of raw beef in it. shaders and havok animation data. the models are probably those...

Image

that's what vertex and index buffers look like. gotta love good aligned raw data. excellent display. data *SPAM*. :mrgreen:
  • Author
  • Localization

Linus, posted Fri Feb 16, 2018 5:23 pm (32521)


Alright, let me know when you find out how to extract them! :D
  • Author
  • Localization

episoder, posted Fri Feb 16, 2018 5:48 pm (32524)


i was just about to edit: extractor done. the bms data shuffler, cause they don't h2o the way they are stored.

Code:
log MEMORY_FILE 0 0 ; out

get relofs_idx long
put relofs_idx long -1
get nr_indices long
put nr_indices long -1
get stride long
put stride long -1
get nr_vertices long
put nr_vertices long -1

for v = 1 to nr_vertices
   get tc_u long
   get tc_v long
   get pos_x long
   get pos_z long
   get pos_y long

   put pos_x long -1
   put pos_y long -1
   put pos_z long -1
   put tc_u long -1
   put tc_v long -1

   xmath skip "(stride / 4) - 5"
   for s = 1 to skip
      get blah long
      put blah long -1
   next s
next v

for i = 1 to nr_indices
   get indx short
   put indx short -1
next i

get buffered asize -1
get name FILENAME 0
string name -= 4
string name = _reshf.dat
log name 0 buffered -1


edit: modified to take the extractor output spec. should work flawless for 64 byte fvfsize aligned meshes (characters) only.
  • Author
  • Localization

Linus, posted Sat Feb 17, 2018 12:16 am (32536)


Well, looks like I'll have to learn some hex editing now (I have almost no experience with this kind of stuff lol). But thanks so much for the help you guys! :D
  • Author
  • Localization

episoder, posted Sun Feb 18, 2018 10:12 pm (32595)


i was bored. :mrgreen:

extracts all textures of the provided level file. square textures work sorta flawless. non-square show up screwed or may crash your viewer on odd resolutions. same as most normal maps. you gotta hex the headers manually. just width and height. use power of 2. also the textures are all dxt1. on dxt5 textures you gotta flip the fourcc if you can pin them. easy tho, i think. :D

edit: xcuse me. i'm an idiot. i totally ignored the other offsets. :lol: i shouldn't have done that.

extracts the raw buffers of the models now too. you still gotta h2o them. i can't/don't need and won't start to try to figure all the fvf format variations. it's upto you. i gave you the shuffler. you can modify it as you need to reposition the data. i calculated and put the index offset, index count, stride (fvfsize), and vertex count on top of the model dat files. makes it easier to work with. those aligned meshes (character models) should start around model 100. the lil lionus is 106. that's clear. enjoy. :D

xtrct_level.rar

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.