Jump to content

[PS2] The Sopranos: Road to Respect .SGP2 models (model/texture bundles?)


Recommended Posts

  • Engineer
Posted (edited)

We'll need another method than usual to create triangle strips without extra lines/faces:

wrong line1.png

indices (groups)

g SM1
f 30/30 32/32 31/31
f 31/31 32/32 33/33
f 32/32 34/34 33/33
f 33/33 34/34 35/35

g SM4 (2)
f 44/44 46/46 45/45
f 45/45 46/46 47/47
f 46/46 48/48 47/47
f 47/47 48/48 49/49
f 48/48 50/50 49/49
f 49/49 50/50 51/51
g SM5 (3)
f 50/50 52/52 51/51
f 51/51 52/52 53/53
f 52/52 54/54 53/53
f 53/53 54/54 55/55
f 54/54 56/56 55/55
f 55/55 56/56 57/57

 

A further split of sub mesh 2) shows the problem, two overlapping faces (which share one vertex only, interestingly):

edit: there's 3 overlapping faces, to be precise.

what.png

(If we decided to claim the upper face being the wrong one we'd loose a vertex, btw. So the lower one is the troublemaker, imho.

Instead of the most right lower vertex it should connect to the more left one...

I swapped its indices but lost overview somehow...

Edited by shak-otay
  • Like 1
Posted
13 hours ago, shak-otay said:

We'll need another method than usual to create triangle strips without extra lines/faces:

wrong line1.png

indices (groups)

g SM1
f 30/30 32/32 31/31
f 31/31 32/32 33/33
f 32/32 34/34 33/33
f 33/33 34/34 35/35

g SM4 (2)
f 44/44 46/46 45/45
f 45/45 46/46 47/47
f 46/46 48/48 47/47
f 47/47 48/48 49/49
f 48/48 50/50 49/49
f 49/49 50/50 51/51
g SM5 (3)
f 50/50 52/52 51/51
f 51/51 52/52 53/53
f 52/52 54/54 53/53
f 53/53 54/54 55/55
f 54/54 56/56 55/55
f 55/55 56/56 57/57

 

A further split of sub mesh 2) shows the problem, two overlapping faces (which share one vertex only, interestingly):

edit: there's 3 overlapping faces, to be precise.

what.png

(If we decided to claim the upper face being the wrong one we'd loose a vertex, btw. So the lower one is the troublemaker, imho.

Instead of the most right lower vertex it should connect to the more left one...

I swapped its indices but lost overview somehow...

Could this be at least worked around tho?

  • Engineer
Posted (edited)

Why not - but how?

I had success with other PS2 models when removing doubles before creating faces. Didn't work here so far.

v -6.143348 -2.421984 4.871326 <<<<<
vt 0.539001 0.373505  
v -6.245219 -2.955531 1.904739
vt 0.543824 0.324257  
v -6.143348 -2.421984 4.871326 <<<<<
vt 0.539001 0.373505 

 

edit: I was so focussed on uvs that I didn't realize how weird this mesh is; need a better one as an example.

Sop_mesh_06.png

 

Here it worked:

remove doubles.png

Edited by shak-otay
Posted
12 hours ago, shak-otay said:

Why not - but how?

I had success with other PS2 models when removing doubles before creating faces. Didn't work here so far.

v -6.143348 -2.421984 4.871326 <<<<<
vt 0.539001 0.373505  
v -6.245219 -2.955531 1.904739
vt 0.543824 0.324257  
v -6.143348 -2.421984 4.871326 <<<<<
vt 0.539001 0.373505 

 

edit: I was so focussed on uvs that I didn't realize how weird this mesh is; need a better one as an example.

Sop_mesh_06.png

 

Here it worked:

remove doubles.png

You mean I should remove the lines "v -6.143348 -2.421984 4.871326" or similar in the models?

Posted
12 hours ago, shak-otay said:

Why not - but how?

I had success with other PS2 models when removing doubles before creating faces. Didn't work here so far.

v -6.143348 -2.421984 4.871326 <<<<<
vt 0.539001 0.373505  
v -6.245219 -2.955531 1.904739
vt 0.543824 0.324257  
v -6.143348 -2.421984 4.871326 <<<<<
vt 0.539001 0.373505 

 

edit: I was so focussed on uvs that I didn't realize how weird this mesh is; need a better one as an example.

Sop_mesh_06.png

 

Here it worked:

remove doubles.png

A little thoughts on this, I've been working on a PS2 model file also and encounter this. In my file there seem to be a sort of identifier for that the vert index being in the pack is the start of a UV Island and when I built submeshes based on those I got a cleaner model, but I checked sample files from this and I don't see the same structure as mine.

  • Like 1
  • Engineer
Posted
7 hours ago, huckleberrypie said:

You mean I should remove the lines "v -6.143348 -2.421984 4.871326" or similar in the models?

No. I meant to use blender to remove doubles.

Posted (edited)
On 1/23/2025 at 11:14 AM, roocker666 said:

OK, each mesh has a header and some unknow bytes are there. I chose these as ID "80 00 00 00 40 02 30 12 05 00 00" to collect all meshes but bytes "40 02" changes in some meshes so now I chose only these bytes as ID: 30 12 05 00 00. Now it reads all meshes but we have a new problem, there are a lot of extra faces, lol(this shit always happens with PS2 models). I guess you can delete those manually. Yes, UVs look fine I think. Here is the script if you want to test it

chris_fix.PNG

fmt_the_sopranos_ps2_sgp2.py 1.46 kB · 7 downloads

Was checking out the samples and in 0x15300 the Integer value of 59600 corresponds with the what I refer as the model's chunk size.
image.png.6543f8ed36f13798accf6302f2248899.png

Assuming the first 16 bytes are header info we skip the value right at the start of the chunk data 0x15310 we end up at the end of the mesh.
image.png.ca330e0c20a69174fa5b78050b8afcda.png


Each model should be made of multiple submeshes, where the information is also stored alongside it's name, in 0x15310, the submesh has 54 verts packed in 32 bytes, in total 1728 bytes, where the vert data starts at 0x1530C, and an additional 4 bytes of 00 00 00 17 that end the submesh chunk. Reading only within the model's total chunk gives me 21 Submeshes in total, which are built correctly, and if I build more it gets broken.

image.thumb.png.3a95ea8a37d251a3271cdcfaf6d7def1.png

image.thumb.png.2e27e2fb9828371eade7c221e4c9f634.png

image.thumb.png.67f4594d9e7873eb402d96c0255f12b4.png

Also, I think the 4 bytes right before the vert data is how it should build the faces to fill blanks but curious as to why its only per submesh that it changes, and not stored as a flag along with the verts
This was actually alot closer to the PS2 Format I was working on before than I thought when I looked more clearly into the file's structure

Edited by Eraea
typo fix and some additional info
  • Like 3
Posted
On 2/3/2025 at 9:36 AM, Eraea said:

Was checking out the samples and in 0x15300 the Integer value of 59600 corresponds with the what I refer as the model's chunk size.
image.png.6543f8ed36f13798accf6302f2248899.png

Assuming the first 16 bytes are header info we skip the value right at the start of the chunk data 0x15310 we end up at the end of the mesh.
image.png.ca330e0c20a69174fa5b78050b8afcda.png


Each model should be made of multiple submeshes, where the information is also stored alongside it's name, in 0x15310, the submesh has 54 verts packed in 32 bytes, in total 1728 bytes, where the vert data starts at 0x1530C, and an additional 4 bytes of 00 00 00 17 that end the submesh chunk. Reading only within the model's total chunk gives me 21 Submeshes in total, which are built correctly, and if I build more it gets broken.

image.thumb.png.3a95ea8a37d251a3271cdcfaf6d7def1.png

image.thumb.png.2e27e2fb9828371eade7c221e4c9f634.png

image.thumb.png.67f4594d9e7873eb402d96c0255f12b4.png

Also, I think the 4 bytes right before the vert data is how it should build the faces to fill blanks but curious as to why its only per submesh that it changes, and not stored as a flag along with the verts
This was actually alot closer to the PS2 Format I was working on before than I thought when I looked more clearly into the file's structure

I can't wait for the update 😄

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...