Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Your GEOM parser may be inaccurate. #35

Open
anonhostpi opened this issue Sep 8, 2024 · 1 comment
Open

Your GEOM parser may be inaccurate. #35

anonhostpi opened this issue Sep 8, 2024 · 1 comment

Comments

@anonhostpi
Copy link

This may not be accurate

  • int numFacePointSizes = r.ReadInt32();
    if (checking) if (numFacePointSizes != 1)
    throw new InvalidDataException(String.Format("Expected number of face point sizes to be 1, read {0}, at 0x{1:X8}", numFacePointSizes, s.Position));
    byte facePointSize = r.ReadByte();
    if (checking) if (facePointSize != 2)
    throw new InvalidDataException(String.Format("Expected face point size to be 2, read {0}, at 0x{1:X8}", facePointSize, s.Position));
    faces = new FaceList(handler, s);
    if (version == 0x00000005)
    {
    skinIndex = r.ReadInt32();
    }
    else if (version == 0x0000000C)
    {
    unknownThings = new UnknownThingList(handler, s);
    unknownThings2 = new UnknownThing2List(handler, s);
    }

See the contents of "> Modified GEOM ksy"

@kitlith
Copy link

kitlith commented Sep 9, 2024

instead of throwing the kaitai struct definition at them, since they're not using it and may not be familiar with it, how about this description of the change I'd make to the wiki? (the following is quoted from earlier in that discussion)

From the wiki: http://simswiki.info/wiki.php?title=Sims_3:0x015A1849

DWORD ItemCount                 // will usually be 1 (hardcoded in pipeline exporter), but sometimes other numbers
--repetition ItemCount:
	BYTE BytesPerFacePoint

DWORD NumFacePoints
--repetition NumFacePoints:
	BYTE[BytesPerFacePoint]	// Given that ItemCount is 1, BytesPerFacePoint is 2, this is a list of WORDs
				// Each set of three forms a face.

according to my pattern file and binrw parser, that last section should be indented, part of the previous repetition group.

like so:

DWORD ItemCount                 // will usually be 1 (hardcoded in pipeline exporter), but sometimes other numbers
--repetition ItemCount:
	BYTE BytesPerFacePoint

        DWORD NumFacePoints
        --repetition NumFacePoints:
	        BYTE[BytesPerFacePoint]	// Given that ItemCount is 1, BytesPerFacePoint is 2, this is a list of WORDs
		        		// Each set of three forms a face.

naming on the wiki is a little weird, I'm pretty sure this is just a list of index buffers used for 3d rendering.

I have a piece of sims 3 custom content that the was motivation for that change, I still need to go check if I can share/link it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants