Jump to content

[PS2] EyeToy:Play


Go to solution Solved by Bigchillghost,

Recommended Posts

Posted (edited)

That model has 4 meshes(body, face, Lhand, Rhand) but there are no pointers to those meshes.. So I just analyzed first mesh;

1st Mesh(Body)
0xF0: 4 bytes(count 5168); 4 bytes unk; 4 bytes unk2
Unknow buffer(Float): 0xfc - 0x143fc(padding 4)
Normals buffer(Float): 0x143fc - 0x286fc(padding 4)
Vertices buffer(Float): 0x286fc - 0x3c9fc padding 4
Uvs buffer(Float): 0x3c9fc - 0x50cfc(padding 8)
------------------------------------------------------

This Mesh has 4 buffers or blocks(probably same in all meshes), I don't know how to collect all meshes. No faces data, you need to create faces..

Using Model Researcher(Normals, verts, Uvs):

 

 

KIEU_1ST_MESH_NORMALS.PNG

KIEU_1ST_MESH.PNG

KIEU_1ST_MESH_UVS.PNG

Edited by roocker666
  • Like 1
Link to comment
Share on other sites

image.png.a62390130fae99ed6ec5a8b79cedf336.png

Here's what I got with Kieu, I think first it counts the frames, then counts the model, then ends with the rig. image.thumb.png.a9e66a2603ffe822e52f2cae61578310.png

Other models (This being Kieu from another minigame) have similar data, so most of this information could easily be transferred to to other models

image.thumb.png.4643ecebba9d088550338f558ce8bc25.png

Same story with characters that are not Kieu, the one being pictured is Yumi. 

 

Would this information be useful for a model viewer or extraction script? 

Link to comment
Share on other sites

Posted (edited)
4 hours ago, roocker666 said:

That model has 4 meshes(body, face, Lhand, Rhand) but there are no pointers to those meshes.. So I just analyzed first mesh;

1st Mesh(Body)
0xF0: 4 bytes(count 5168); 4 bytes unk; 4 bytes unk2
Unknow buffer(Float): 0xfc - 0x143fc(padding 4)
Normals buffer(Float): 0x143fc - 0x286fc(padding 4)
Vertices buffer(Float): 0x286fc - 0x3c9fc padding 4
Uvs buffer(Float): 0x3c9fc - 0x50cfc(padding 8)
------------------------------------------------------

This Mesh has 4 buffers or blocks(probably same in all meshes), I don't know how to collect all meshes. No faces data, you need to create faces..

Using Model Researcher(Normals, verts, Uvs):

 

 

KIEU_1ST_MESH_NORMALS.PNG

KIEU_1ST_MESH.PNG

KIEU_1ST_MESH_UVS.PNG

 

 

 

 

I've also found flat versions of the model for some reason, thanks for showing me how to do this, it's been great help! 

image.png.8eee0080fe41abd5b90a6ab93897b419.png

Edited by Thatonebruh196
Link to comment
Share on other sites

First we need to find a way to collect all meshes. Most of the time, PS2 meshes have some specific bytes that appear in all meshes(always same bytes).

I noticed that these 4 bytes "27 00 00 00" appear in all meshes(vertices count is 8 bytes before that) So that is a hint, if you search for those bytes you can find meshes. (I am still trying to understand mesh header..)

Specific bytes in meshes.PNG

Link to comment
Share on other sites

7 minutes ago, roocker666 said:

First we need to find a way to collect all meshes. Most of the time, PS2 meshes have some specific bytes that appear in all meshes(always same bytes).

I noticed that these 4 bytes "27 00 00 00" appear in all meshes(vertices count is 8 bytes before that) So that is a hint, if you search for those bytes you can find meshes. (I am still trying to understand mesh header..)

Specific bytes in meshes.PNG

Ah, interesting, I've also noticed that some characters are counted with the props in the background (Vernon in the screenshot for instance). Also it'd probably be hard to find them as I am still a Model Researcher noob lol 

 

 image.png.4d8e6b995c30fc82bc9a07f64b6b8f2f.png

Link to comment
Share on other sites

5 minutes ago, Thatonebruh196 said:

Ah, interesting, I've also noticed that some characters are counted with the props in the background (Vernon in the screenshot for instance). Also it'd probably be hard to find them as I am still a Model Researcher noob lol 

Can you upload more model files? I wanna check if those bytes appear in all models

Link to comment
Share on other sites

4 minutes ago, roocker666 said:

Can you upload more model files? I wanna check if those bytes appear in all models

Here's some more examples! I've included Vernon, Yumi and Kieu's model from a different minigame, I've also included Yumi and Vernon's model from the same minigame. 

EyeToy Models.zip

Link to comment
Share on other sites

12 minutes ago, Thatonebruh196 said:

Here's some more examples! I've included Vernon, Yumi and Kieu's model from a different minigame, I've also included Yumi and Vernon's model from the same minigame. 

Thanks, yeah all models have those bytes(27 00 00 00) in meshes but the file "RM08_YUME_NEW_SKEL.ETC" has more meshes with different bytes "23 00 00 00" The only difference is that meshes with bytes "23 00 00 00" don't have the first Unknow buffer, it seems like the first buffer is actually Normals buffer:

bytes 23 00 00 00 in meshes.PNG

  • Like 1
Link to comment
Share on other sites

6 minutes ago, roocker666 said:

Thanks, yeah all models have those bytes(27 00 00 00) in meshes but the file "RM08_YUME_NEW_SKEL.ETC" has more meshes with different bytes "23 00 00 00" The only difference is that meshes with bytes "23 00 00 00" don't have the first Unknow buffer, it seems like the first buffer is actually Normals buffer:

bytes 23 00 00 00 in meshes.PNG

Ah, thank you, would there be any way to restore the faces or tris btw? 

Link to comment
Share on other sites

Posted (edited)
24 minutes ago, Thatonebruh196 said:

Ah, thank you, would there be any way to restore the faces or tris btw? 

Model Researcher can't generate faces, So we need to create a script for Noesis or use other extraction tools like Hex2Obj or AXE

I will try to check that tomorrow because is 02:29 am here, lol. 

Edited by roocker666
Link to comment
Share on other sites

Posted (edited)
8 hours ago, shak-otay said:

You can use fake faces from hex2obj - then toggle face cull (F4) in Noesis.

Finally superfluous faces to be deleted.

(There must be some better auto generating algo but I didn't find it so far.)

I remember some scripts to generate faces, Sparagas created these. I think are based on a function by Bigchillghost, I can't remember very well, lol.

Maybe these could help:

Generate-Faces last version.zip

Edited by roocker666
  • Like 2
Link to comment
Share on other sites

Posted (edited)

I see. The tri strips function is the same as hex2obj uses ("standard tri strips", as I would call them).

I compared to that which I called "Noesis", the different lines of the latter are marked here:

f 1/1 2/2 3/3
f 4/4 3/3 2/2 <
f 3/3 4/4 5/5
f 6/6 5/5 4/4 <
f 5/5 6/6 7/7
f 8/8 7/7 6/6 <

That is the last index in the marked line is put as first one,

so f 1 2 3

f 2 4 3

etc.

to get the hex2obj tri strips.

Sadly both algo's produce superfluous faces and require a face cull.

(I think I'll check for double vertices. That helped for some PS2 formats, iirc.)

edit: no good idea; after "remove doubles" only 1504 vertices were left. That's way to less...

Edited by shak-otay
  • Like 1
Link to comment
Share on other sites

47 minutes ago, shak-otay said:

Sadly both algo's produce superfluous faces and require a face cull.

(I think I'll check for double vertices. That help for some PS2 formats, iirc.)

That sucks.. I guess we need to use those "Flags" after vertices, there are two shorts. Sometimes appear FF FF FF FF and sometimes 20 00 00 00.

I used just the first short 20 00 (from second type 20 00 00 00) as Flag but is was a mess.. then Used first short FF FF(from 1st type) and it works! But I cut the first mesh and pasted in a new file. So the script for Noesis only works on splitted meshes, lol.

Flag FF FF.PNG

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Posted (edited)
2 hours ago, roocker666 said:

Here is the plugin for Noesis but you need to cut each mesh and paste in a new file and save it as .ETC and in Noesis prees F4 for face cull

Noesis plugin and 1st mesh.rar 64.54 kB · 3 downloads

I am unable to use these, I always get an error when I try to load in the edited file. Here's the error message I get 

Detected file type: EyeToy: Play, PS2
Vnum: 5168
Traceback (most recent call last):
  File "D:\noesisv4473\plugins\python\fmt_eyetoy_play_ps2_single_mesh_etc .py", line 27, in LoadModel
    Unkbuf = bs.read(vnum*16) 
  File "D:\noesisv4473\plugins\python\inc_noesis.py", line 178, in read
    self.toUnpacker(); r = noeSuper(self).read(fmtStr); self.fromUnpacker(); return r
  File "D:\noesisv4473\plugins\python\inc_noesis.py", line 32, in read
    readBytes = struct.calcsize(fmtStr)
TypeError: Struct() argument 1 must be a bytes object, not int

 

(Also would a script for automatically disassembling the file be feasible? 
 

Edited by Thatonebruh196
Link to comment
Share on other sites

11 minutes ago, roocker666 said:

Weird, It works fine on my PC. Try to run Noesis as administrator

I still got the same error, is it because I was using "Noesis64" and not "Noesis"? I can only really open Noesis 64 as Noesis itself just won't open for me 

Link to comment
Share on other sites

18 minutes ago, Thatonebruh196 said:

I still got the same error, is it because I was using "Noesis64" and not "Noesis"? I can only really open Noesis 64 as Noesis itself just won't open for me 

Noesis64.exe is for 64-bit operating systems, Noesis.exe is for 32-bit operating systems. If you can open Noesis64.exe that means your operating system is 64-bit so you can open both. Maybe there is a problem with your Noesis files, I don't know... Try to download Noesis again and extract the files in your documents folder. If that does not help I don't know how to solve the problem, sorry.

Link to comment
Share on other sites

2 minutes ago, roocker666 said:

Noesis64.exe is for 64-bit operating systems, Noesis.exe is for 32-bit operating systems. If you can open Noesis64.exe that means your operating system is 64-bit so you can open both. Maybe there is a problem with your Noesis files, I don't know... Try to download Noesis again and extract the files in your documents folder. If that does not help I don't know how to solve the problem, sorry.

I've already done that, I was thinking it was some incompatibility with older versions, so I guess I'm out of luck with the Noesis script then...

Link to comment
Share on other sites

Posted (edited)
18 hours ago, roocker666 said:

I used just the first short 20 00 (from second type 20 00 00 00) as Flag but is was a mess.. then Used first short FF FF(from 1st type) and it works! 

Seems to be some mix encoding of triangle and strip. I edited your script and flipped the X axis to produce a unified face winding direction. 

image.png.4c7c3a487b484403f4d8d181a1cdc8ad.png

 

Edited: removed flipping of the X axis due to bad effect on the vertex normal.

 

fmt_eyetoy_play_ps2_single_mesh_etc_edited.zip

Edited by Bigchillghost
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Posted (edited)

@Thatonebruh196: because you seem to use the original .etc file, not the cut one.

------------

As Bigchillghost mentioned there's a mix of triangles and tri strips.

When counting the lines from here in the obj file:

f 1 2 3

you'll find line 34:
f 100 101 102

where 100 is 3*(34-1)+1 which is pretty linear. Up to line 43, then f 129 128 130 appears, which is a start of strips.

From here f 175 176 177 linear again.

----

(I've used C code to reproduce roocker666's script but without normals.

I had adapted TriList(skipList) from the ShaolinMonks' thread already, that's why I didn't use the updated script from Bigchillghost.)

What confuses me a little bit is rapi.rpgCommitTriangles(triangles, noesis.RPGEODATA_INT, len(triangles)// 4, noesis.RPGEO_TRIANGLE, 1)

Usually CommitTriangles creates faces from a face index buffer (pointer? to buffer triangles here) and modifies it depending on the parameter RPGEO_xxx,

where xxx=TRANGLE or TRIANGLE_STRIP for example. From my understanding. But what does it do here exactly? Just copy the index values?

That's why I prefer using C which is more transparent to me.  In a createTriList() clone I directly log the auto created face indices like so:

if (faceDir > 0) fprintf( stream, "f %d %d %d\n", f1+1, f2+1, f3+1 ) ;
                else fprintf( stream, "f %d %d %d\n", f2+1, f1+1, f3+1 ) ;

But I get a different shading when dragging/dropping the C-apps obj output onto Noesis (for "toggle face cull"):

https://imgbox.com/06Myv6HF

I hope that's because I didn't create normals from the .etc file.

Edited by shak-otay
  • Like 1
Link to comment
Share on other sites

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...