The Legend of Spyro: The Eternal Night models extraction
Posted: Mon Jan 18, 2021 7:25 pm
Hello!
I need to extract some models from TLoS. I spent some time with ninja ripper, PCSX2 snapshots and so far extracting .mdg files directly gave me the biggest success so far. The problem is that I am stuck now.
I found that there was a website once having all models of the game available, however it does not exist anymore.
Here is archive.org link: https://web.archive.org/web/20171221103 ... yro+Series
Unfortunately none of the files were archived, only the link.
I found the script on this website(viewtopic.php?t=6360), unfortunately it does not work properly.
Here is the result of that script:
https://imgur.com/a/om9DDI6
For me it looks like vertexes are OK but faces are wrong.
I would be extremely grateful for any help. I only need to be able to get proper models somehow.
Thank you.
I need to extract some models from TLoS. I spent some time with ninja ripper, PCSX2 snapshots and so far extracting .mdg files directly gave me the biggest success so far. The problem is that I am stuck now.
I found that there was a website once having all models of the game available, however it does not exist anymore.
Here is archive.org link: https://web.archive.org/web/20171221103 ... yro+Series
Unfortunately none of the files were archived, only the link.
I found the script on this website(viewtopic.php?t=6360), unfortunately it does not work properly.
Code: Select all
-- .mdg import
chunk_id = 0x6c028000
chunk_end_id = 0x14000000
chunk_size = 0xcc
verts_count = 0;
ids_count = 0;
vertex_array = #()
face_array = #()
file_name = getOpenFileName \
caption:"Legend of Spyro Model File" \
types:"Legend of Spyro Model File(*.mdg)|*.mdg" \
historyCategory:"Legend of SpyroObjectPresets"
if file_name != undefined then
f = fopen file_name "rb"
if f != undefined then (
fseek f 0 #seek_end
size = ftell f
fseek f 40 #seek_set
while size > ftell f do (
while ReadLong f #unsigned == chunk_id do (
verts_count = ReadLong f #unsigned
weight = ReadFloat f
fseek f 32 #seek_cur
for i = 1 to verts_count do (
x = ReadFloat f
y = ReadFloat f
z = ReadFloat f
append vertex_array [x, z, y]
)
ids_count = ids_count + verts_count
while ReadLong f #unsigned != chunk_end_id do ()
)
if ids_count != 0 do (
for i = 1 to ids_count - 2 do
append face_array [ i , i + 1 , i + 2 ]
new_mesh = mesh vertices:vertex_array faces:face_array
ids_count = 0;
vertex_array = #()
face_array = #()
)
)
fclose f
)https://imgur.com/a/om9DDI6
For me it looks like vertexes are OK but faces are wrong.
I would be extremely grateful for any help. I only need to be able to get proper models somehow.
Thank you.
