Silver 3d models and animations (CHR and ANM files)

Post questions about game models here, or help out others!
nerdyluke
beginner
Posts: 36
Joined: Sun Dec 29, 2013 4:46 pm
Been thanked: 8 times

Silver 3d models and animations (CHR and ANM files)

Post by nerdyluke » Wed Jan 01, 2014 11:34 am

Hi,

I'm trying to extract the 3D models from Silver (1999) by Spiral House. It is a 2.5D RPG with prerendered backgrounds and low poly 3D models. I've already been able to extract the game backgrounds, sound fx and most of the sprites so I guess it shouldn't be too complicated aswell. It seems each model is a .CHR file and has a .ANM file when it has an animation. If it can help, the .CHR header always begins like this:

00 80 00 00 XX XX XX XX
where X's are file size in bytes.

I've uploaded 3 models that should be simple enough, and 3 unrelated animation files. Can anyone help with these please?
Here are the files: http://nerd.perso.sfr.fr/silver/

Thank you ! (:

User avatar
TaylorMouse
ultra-veteran
ultra-veteran
Posts: 367
Joined: Mon Sep 26, 2011 12:51 pm
Has thanked: 13 times
Been thanked: 125 times

Re: Silver 3d models and animations (CHR and ANM files)

Post by TaylorMouse » Thu Jan 02, 2014 10:12 am

LOVED THAT GAME, I even bought it recently from GOG.COM !

Btw, what did you use to get these backgrounds and sounds?

I'll take a look at the models this evening

T.

nerdyluke
beginner
Posts: 36
Joined: Sun Dec 29, 2013 4:46 pm
Been thanked: 8 times

Re: Silver 3d models and animations (CHR and ANM files)

Post by nerdyluke » Thu Jan 02, 2014 11:20 am

Hi T. Mouse & thx for quick reply :)

Yes that game was my very first RPG, have really fond memories of it :P the music was really good too. There seems to be three different versions: the regular one with a silver folder on each CD that contains the folders 'chars', 'levels', 'sprites' and 'sound'; the US version in which the silver folder only contains fat1.nob/fat2.nob and data1.nob/data2.nob; and the GOG version which is similar to the first version except that the silver folder from the CDs is copied in the Program Files\GOG.com\silver\data folder. The sound fx are mostly in the sound folder, and the 2D backgrounds are in the .PAK files in the 'levels' subfolders. Those PAK files must be deRNC'd first and then at the start of the file there's a 256color palette + pixel data after that. I suspect the rest of the .PAK contains collision (perhaps a 3d invisible mesh of the background)/z-index information (the game is 2.5D, so there are static backgrounds but you could still go behind/in front of certain parts of the backgrounds and collide with them (eg. David's house below). I can clean up my little extractor's code and send it to you if you're interested (can split silver's fat/nob files, extract .RAW images (for the menu background and world map), level backgrounds and about 75% of the static 2D sprites (rest seem to be animated sprites that I've not yet been able to understand the format :( ) ?

Image

nerdyluke
beginner
Posts: 36
Joined: Sun Dec 29, 2013 4:46 pm
Been thanked: 8 times

Re: Silver 3d models and animations (CHR and ANM files)

Post by nerdyluke » Fri Jan 10, 2014 6:12 pm

Sry to bump but has anyone had a look at those CHRs? Does anyone know how they are structured?

nerdyluke
beginner
Posts: 36
Joined: Sun Dec 29, 2013 4:46 pm
Been thanked: 8 times

Re: Silver 3d models and animations (CHR and ANM files)

Post by nerdyluke » Sun Jan 19, 2014 5:20 pm

edited, found something interesting
Last edited by nerdyluke on Sat May 10, 2014 12:34 am, edited 2 times in total.

nerdyluke
beginner
Posts: 36
Joined: Sun Dec 29, 2013 4:46 pm
Been thanked: 8 times

Re: Silver 3d models and animations (CHR and ANM files)

Post by nerdyluke » Sat Jan 25, 2014 12:15 am

While browsing the game archive again I've found a "anims/SHAPES" directory I didn't see at first. It contains 67 *.AS files eg "SH2224.AS" and sometimes the .AS file has a .S3D file with it. The .AS files are plain text, here's SH2224.AS:

Code: Select all

Origin 12.000000 0.000050 70.000130
Named object: "LCalf"
Tri-mesh, Vertices: 11     Faces: 14
Mapped
Vertex list:
Vertex 0:  X:12     Y:-6.999949     Z:69.999977     U:0.498397     V:0.49062
Vertex 1:  X:22     Y:3.000033     Z:69.999977     U:0.811542     V:0.49062
Vertex 2:  X:12     Y:13.000027     Z:69.999977     U:0.498397     V:0.49062
Vertex 3:  X:2     Y:3.000033     Z:69.999977     U:0.185253     V:0.49062
Vertex 4:  X:12     Y:-6.999982     Z:18.000586     U:0.498397     V:0.008954
Vertex 5:  X:20     Y:1.000015     Z:17.999973     U:0.748913     V:0.008951
Vertex 6:  X:12     Y:9.000015     Z:17.999969     U:0.498397     V:0.008951
Vertex 7:  X:4     Y:1.000015     Z:17.999973     U:0.247882     V:0.008951
Vertex 8:  X:28     Y:9.000024     Z:56.999969     U:0.999429     V:0.370203
Vertex 9:  X:-4     Y:9.000024     Z:56.999969     U:-0.002634     V:0.370203
Vertex 10:  X:12     Y:25.000029     Z:56.999966     U:0.498397     V:0.370203
Face list:
Face 0:    A:4 B:5 C:8 AB:1 BC:1 CA:0
Material:"DVD LEG F"
Smoothing:  2
Face 1:    A:0 B:8 C:1 AB:0 BC:1 CA:1
Material:"DVD LEG F"
Smoothing:  2
Face 2:    A:8 B:5 C:6 AB:1 BC:1 CA:0
Material:"DVD LEG K"
Smoothing:  1
Face 3:    A:1 B:10 C:2 AB:0 BC:1 CA:1
Material:"DVD LEG K"
Smoothing:  1
Face 4:    A:10 B:6 C:7 AB:1 BC:1 CA:0
Material:"DVD LEG K"
Smoothing:  1
Face 5:    A:2 B:9 C:3 AB:0 BC:1 CA:1
Material:"DVD LEG K"
Smoothing:  1
Face 6:    A:9 B:7 C:4 AB:1 BC:1 CA:0
Material:"DVD LEG F"
Smoothing:  2
Face 7:    A:0 B:3 C:9 AB:1 BC:1 CA:0
Material:"DVD LEG F"
Smoothing:  2
Face 8:    A:8 B:0 C:4 AB:0 BC:1 CA:0
Material:"DVD LEG F"
Smoothing:  2
Face 9:    A:8 B:6 C:10 AB:0 BC:1 CA:1
Material:"DVD LEG K"
Smoothing:  1
Face 10:    A:9 B:2 C:10 AB:0 BC:1 CA:1
Material:"DVD LEG K"
Smoothing:  1
Face 11:    A:9 B:4 C:0 AB:0 BC:1 CA:0
Material:"DVD LEG F"
Smoothing:  2
Face 12:    A:10 B:1 C:8 AB:0 BC:1 CA:1
Material:"DVD LEG K"
Smoothing:  1
Face 13:    A:10 B:7 C:9 AB:0 BC:1 CA:1
Material:"DVD LEG K"
Smoothing:  1
There is no mention of ".AS" in the disassembled exe, so I'm assuming those .AS files are leftover which werent meant to be included in the game archive (which would explain why it starts at SH2224 and there are only 67 of those) ? I'm not familiar with 3d model animation formats, but has anyone seen this kind of plain text file before?

EDIT: Also I think "DVD" stands for DAVID, which is the main character in the game, and it seems every .AS file contains part of david's model (DVD_LEG, DVD_HILT, DVD_FOOT etc). Could those .AS be the unpacked david model by any chance? :o

User avatar
TaylorMouse
ultra-veteran
ultra-veteran
Posts: 367
Joined: Mon Sep 26, 2011 12:51 pm
Has thanked: 13 times
Been thanked: 125 times

Re: Silver 3d models and animations (CHR and ANM files)

Post by TaylorMouse » Sun Jan 26, 2014 12:21 pm

Did you convert it to a model ?

T.
You do not have the required permissions to view the files attached to this post.

nerdyluke
beginner
Posts: 36
Joined: Sun Dec 29, 2013 4:46 pm
Been thanked: 8 times

Re: Silver 3d models and animations (CHR and ANM files)

Post by nerdyluke » Sun Jan 26, 2014 1:23 pm

yeah, theyre 3D Studio .ASC files, also they're not in the later dreamcast version, I think they included it by mistake (there's only david's .AS files and a bunch of .S3D, there's also a .bat there that probably wasn't meant to be included either :mrgreen: . Taking a look at the 3DS chunk-based format, it seems that the .CHR also has 'chunks' eg if you look up david.chr ( http://nerd.perso.sfr.fr/silver/david.chr ), there seems to be chunks of floats at offsets 196, 984 1764 etc, which I believe are all part of david's model (head, foot etc, each chunk corresponding to a .AS file). But so far I've failed to recognize the vertices from the .AS in david.chr (don't know much about 3d models, but they could be scaled ?). I've uploaded all the .AS and .S3D in a zip file here if you'd like to take a look: http://nerd.perso.sfr.fr/silver/SHAPES.zip
I think we're making progress :P

nerdyluke
beginner
Posts: 36
Joined: Sun Dec 29, 2013 4:46 pm
Been thanked: 8 times

Re: Silver 3d models and animations (CHR and ANM files)

Post by nerdyluke » Sun Jan 26, 2014 7:44 pm

ok, I've confirmed the first floats in the float array are the vertices, I've plotted the vertices from CHEESE.CHR (see attachment). The remaining floats in the chunk must be the UV. Now on to find faces 8)
edit: also found vertice count
You do not have the required permissions to view the files attached to this post.

User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 2628
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 647 times
Been thanked: 1350 times

Re: Silver 3d models and animations (CHR and ANM files)

Post by shakotay2 » Wed Jan 29, 2014 1:33 am

nerdyluke wrote:edit: also found vertice count
How do you think someone could help you if you don't give the details, eh?
So this
# 0xa4: verts= 10
v 0.000000 0.000015 -48.600006
v 40.500000 -0.000015 32.399994
v 16.199997 -0.000015 40.500000
v -16.199997 -0.000015 40.500000
v -40.500000 -0.000015 32.399994
v 0.000000 51.840012 -48.599991
v 40.500000 51.839996 32.400009
v 16.199997 51.839996 40.500000
v -16.199997 51.839981 40.500000
v -40.500000 51.839981 32.400009
f 2 7 6
f 3 8 7
f 4 9 8
f 5 10 9
f 1 6 10
f 7 8 9
f 5 4 3

doesn't give a perfect cheese; some faces missing and I'm not sure of the vertices start address.
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

nerdyluke
beginner
Posts: 36
Joined: Sun Dec 29, 2013 4:46 pm
Been thanked: 8 times

Re: Silver 3d models and animations (CHR and ANM files)

Post by nerdyluke » Wed Jan 29, 2014 6:50 am

Thanks Shakotay, I've also been frustrated by face count but I think they're not triangles, they seem to be polygons, because if you start at offset 367, you have this structure:

Code: Select all

(8 bytes ??) 0 0 33 0 1 0 33 0 6 0 33 0 5 0 33 0
(8 bytes ??) 1 0 34 0 2 0 34 0 7 0 34 0 6 0 34 0
(8 bytes ??) 2 0 34 0 3 0 35 0 8 0 35 0 7 0 34 0
(8 bytes ??) 3 0 35 0 4 0 35 0 9 0 35 0 8 0 35 0
(8 bytes ??) 4 0 34 0 0 0 34 0 5 0 34 0 9 0 34 0
(8 bytes ??) 5 0 34 0 6 0 34 0 7 0 34 0 8 0 34 0 9 0 34 0
(8 bytes ??) 0 0 33 0 4 0 33 0 3 0 33 0 2 0 33 0 1 0 33 0
now if you take the 0th, 4th, 8th and 12th number on each line you get this for polygons:

Code: Select all

0 1 6 5
1 2 7 6
2 3 8 7
3 4 9 8
4 0 5 9
5 6 7 8 9
0 4 3 2 1
which gives you a perfect cheese. But it looks kind of weird, is it common to store faces that way? (it's an old game after all)
Last edited by nerdyluke on Fri Jan 31, 2014 7:47 pm, edited 2 times in total.

User avatar
TaylorMouse
ultra-veteran
ultra-veteran
Posts: 367
Joined: Mon Sep 26, 2011 12:51 pm
Has thanked: 13 times
Been thanked: 125 times

Re: Silver 3d models and animations (CHR and ANM files)

Post by TaylorMouse » Wed Jan 29, 2014 8:36 am

because they are probably not stored by line;

0 1 6 5
1 2 7 6
2 3 8 7
3 4 9 8
4 0 5 9
5 0 7 0 0
0 4 3 2 1

but like this
0 1 6
5 1 2
7 6 2
3 8 7
3 4 9
8 4 0
5 9 5
0 7 0
0 0 4
3 2 1

although the 0 0 4 and 0 7 0 look pretty weird :/

T.

nerdyluke
beginner
Posts: 36
Joined: Sun Dec 29, 2013 4:46 pm
Been thanked: 8 times

Re: Silver 3d models and animations (CHR and ANM files)

Post by nerdyluke » Fri Jan 31, 2014 9:20 am

edit: nvm I made a mistake in my previous post, corrected it, I'll try out your suggestion TaylorMouse

nerdyluke
beginner
Posts: 36
Joined: Sun Dec 29, 2013 4:46 pm
Been thanked: 8 times

Re: Silver 3d models and animations (CHR and ANM files)

Post by nerdyluke » Mon Feb 03, 2014 7:06 pm

Okay, I spent the last weekend studying the format and here are my notes:

Code: Select all

OFFSET						TYPE					COMMENT

20							long					N
32 + N						long					# of chunks (model parts) in this file
44 + N						long					first chunk size in bytes (add 8 bytes to include up to this byte)
60 + N						long					first chunk vertice count (V)
64 + N						long					first chunk polygon count (P, seems to be repeated twice)
80 + N						float[3]				origin (center of mesh ?)
156 + N						float[3 * V]			vertices
156 + N + 12 * V			float[3 * P]			normals
156 + N + 12 * (V + P)		(struct polygon)[P]		byte ??, byte polygon index, byte # of vertices in polygon, byte ??, long ??, in the following bytes one byte out of 4 is the vertex index
I've written a little extractor that follows those specs, and this is what I've come up with so far (APPLE.CHR, CHEESE.CHR and TREASURE.CHR). As you can see, the first two models are fine, but the parts making up the chest are misplaced. It seems to be the case for all models that contain independently animated meshes (the apple and cheese have an animation, but it moves the entire apple, whereas with the chest, only the cover moves. And it is the same for characters (David, Fuge etc)).

Here are the generated .obj making up the parts of TREASURE.CHR:

Box:

Code: Select all

#vertices
v 65.000000 0.000000 40.000137
v -65.000000 0.000000 40.000137
v -65.000000 -0.000015 -40.000122
v 65.000000 -0.000015 -40.000122
v 75.000000 80.000000 50.000061
v -75.000000 80.000000 50.000061
v -75.000000 80.000107 -50.000046
v 75.000000 80.000107 -50.000046
#faces
f 1 4 3 2
f 7 8 5 6
f 8 4 1 5
f 5 1 2 6
f 6 2 3 7
f 7 3 4 8
Cover:

Code: Select all

#vertices
v -75.000000 0.000000 99.999985
v -75.000000 -0.000031 -0.000015
v -75.000000 35.000015 15.000000
v -75.000000 50.000000 49.999954
v -75.000000 35.000000 85.000000
v -75.000000 -0.000000 50.000000
v 75.000000 0.000000 99.999985
v 75.000000 35.000000 85.000000
v 75.000000 -0.000031 -0.000015
v 75.000000 35.000015 15.000000
v 75.000000 50.000000 49.999954
v 75.000000 -0.000000 50.000000
#faces
f 6 2 3 4 5 1
f 8 7 1 5
f 9 10 3 2
f 8 11 10 9 12 7
f 11 8 5 4
f 10 11 4 3
f 2 1 7 9
lock:

Code: Select all

#vertices
v 10.000000 0.000000 -0.000000
v -10.000000 0.000000 -0.000000
v -15.000000 -24.999969 -0.000000
v 7.000000 -39.999969 -0.000000
v 15.000000 -24.999969 -0.000000
v -7.000000 -39.999985 -0.000000
#faces
f 5 4 6 3 2 1
Also I've found three sets of floats after the textures (at the end of the .CHR) which I believe are somehow responsible for positionning the parts because each of them is prefixed with a (part?) index (0-2):

Code: Select all

0 0  0
0 80  -50
0 0  100
I've tried lots of combinations but I can't get the parts to be placed properly (cover over box, lock next to the box etc)

For the textures, I've confirmed they're included in the CHR file towards the end (there's a big section with bytes corresponding to what I've extracted using the PIX debugger, will work on that asap).
You do not have the required permissions to view the files attached to this post.

nerdyluke
beginner
Posts: 36
Joined: Sun Dec 29, 2013 4:46 pm
Been thanked: 8 times

Re: Silver 3d models and animations (CHR and ANM files)

Post by nerdyluke » Tue Feb 04, 2014 6:58 am

I've confirmed my assumptions that the floats towards the end are used for placement of the parts by replacing each of those floats by 0 and looking at how the game reacts. With all floats at 0, the chest parts are misplaced. Now it's only a matter of figuring out how those coordinates are used.
You do not have the required permissions to view the files attached to this post.

Post Reply