Quick Reply
Search this Thread
Test Subject
Original Poster
#1 Old 16th Dec 2025 at 8:12 PM Last edited by SinfulSimming : 17th Dec 2025 at 3:55 AM.
Default GMDC Headache - Vertex Indices?
I've been working on a CC Manager app for two years now, built in C#. I've literally taught myself C# to do it. I'm incredibly proud of how well I've done with this, because it's actually nearly ready for Sims 2 use finally.

Right now, it can read packages and it can get the information from CTSS and XOBJ chunks and I can get it to be like "hey! I'm a fridge!" or whatever, and I can rename the files from the internal name (which is what started this entire journey for me).

Now, I'm on a mission to read the GMDC data and turn it into an object I can take a photo of for a thumbnail. I'm using Godot engine (the mono version, so C#) and I'm getting pretty close, but I've run into a snag and my head hurts

(And yea, I know, "why reinvent the wheel when SimPE exists?" because I am a stubborn bitca who learns by doing and I really, really want to say I did this.)

So, I've managed to go into the GMDC chunk, read out the data enclosed. I've got the Elements, Groups, Linkages etc. I've even compared SimPE against the output I've got and hey! It has the right number of faces and verts!! It's correct!

Except...



I think I know what the problem is. I'm going into the Group, I'm getting the face list, and I'm accessing the vertices according to the face list. The GMDC entry on the Wiki says:

Quote:
To read the geometry, you start with the group. From the link indexed in the group, you read the elements. The vertex list element is the position of the vertices. The face list in the P3(groups) is an array of vertices read in groups of 3 to form faces. The normals element is a list of normal vectors for the vertices. Texture map coordinates stored in a referenced element as well(in [U,V]). These are all standard elements of a group, but bumpmap normals may also be present(mostly body meshes).


which I interpreted to mean you have a list of verts, and your list of faces, and you read the verts from the index. Eg, if your face is 4, 5, 6, you read Vert[4], vert[5], vert[6] to make the face. But this doesn't seem to work. I tried just placing all the verts in a row and no dice there either.

Am I misunderstanding maybe?

My code is here: https://github.com/sixstepsaway/Sim...eReader.cs#L800 the compressed reader version isn't set up yet because I've been working with a single package for testing purposes (which is "MLC-KFCBucketToilet.package" I picked at random lol).

Hoping someone can set me on the right track!

ETA: Okay, I was reading UInt not Int, and fixing that has helped no end LOL. But it's still explodey.

ETA2: I solved it! Did I mention I've been doing C# only two years and taught myself? I was reading a UInt for BlockFormat of 4 and reading a UInt16, when it should have been Int and Single! My mesh is still a mess, but I think maybe that's a problem with how I'm doing it in Godot? We'll see. I will come back and update...
Back to top