Skip to content

Add Capcom's Devil May Cry 3 HD .mod hexpat #415

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

WerWolv
Copy link
Owner

@WerWolv WerWolv commented Jul 2, 2025

Pattern

Hex Pattern file for Capcom's Devil May Cry 3 HD Collection's .mod (3D Models) files
Pattern by @haruse23

Checklist

  • A pattern for this format doesn't exist yet (or this PR improves the existing one)
  • The new pattern has been added to the relevant table in the Readme
  • The new pattern has a description pragma (#pragma description My pattern Description here)
  • The pattern was associated with all relevant MIME types (using #pragma MIME mime-type in the source code)
    • Make sure to never use application/octet-stream here as that means "Unidentifiable binary data"
  • A test file for this pattern has been added to /tests/patterns/test_data
    • Try to keep this file below ~ 1 MB

Copy link
Collaborator

@paxcut paxcut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some suggested changes that will make the results of your pattern easier to read.

struct MeshSCM {
u16 numberVertices;
u16 textureIndex;
u8 padding0[12];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the padding built-in type instead of creating arrays of u8s you don't want to see in the pattern data window anyway. Instead of u8 padding0[12]; use padding[12];. That eliminates the need to create unnecessary variables with 0,1,2,..

u8 padding2[16];
u64 unknownOffset;

u64 unknown;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pattern language allows you define anonymous entries in the patterns you place.so instead of naming each one as in u64 unknown; you can simply dou64;

float y;
float z;
float length; // sqrt(x*x + y*y + z*z)
u8 unknown[16];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this is a 4x4 matrix that can include rotations and other types of transforms that a vector alone can't do. It just seems it is never used it seems.



ModelHeader modelheader @ 0x00;
Object objects[modelheader.objectCount] @ 0x40;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0x40 happens to also be the size of the header so you may prefer to put both inside a pattern but then you will have to change all the places that use the values.

u8 padding1[24];
};

struct Object {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem like it is defining the objects, it only has information about them so maybe rename it to ObjectInfo.

}
};

IthMesh meshes[modelheader.objectCount] @objectOffset;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would make a lot more sense as

Object objects[modelHeader.objectCount] @ objectOffset;

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

Successfully merging this pull request may close these issues.

3 participants