Model / TMdl Editing

Technical discussion of development of third-party apps.
User avatar
StingRay68
Hall of Fame
Posts: 1073
Joined: Mon Jan 09, 2012 7:23 pm

Model / TMdl Editing

Postby StingRay68 » Mon Dec 12, 2016 1:38 pm

mike9472 was kind enough to convert the tutorial into a PDF file. So if anyone wants that to view offline, here it is :
TutorialPDF.zip
(969.64 KiB) Downloaded 687 times

Model / TMdl Editing

Sponsor

Sponsor
 

User avatar
StingRay68
Hall of Fame
Posts: 1073
Joined: Mon Jan 09, 2012 7:23 pm

Re: Model / TMdl Editing

Postby StingRay68 » Mon Dec 12, 2016 1:41 pm

I posted a thread about editing models back in October, 2014 (wow, I didn't think it was that long ago)
viewtopic.php?f=85&t=16771

Anyway the thread had pictures which became corrupted and I didn't feel like redoing everything since I am horrible with graphics programs. I feel like my time is better spent working on madden amp or other editors than trying to provide a tutorial that few people will understand or use.

If you read through that thread it is full of instructions involving hex editing, converting hex code to floating decimals and other technical stuff.

To sum it up, editing a model in madden sure is complicated.
But that's about to change...

I'm going to discuss certain functions in my editor which I've named "MoRE" (Madden Resource Editor).

User avatar
StingRay68
Hall of Fame
Posts: 1073
Joined: Mon Jan 09, 2012 7:23 pm

Re: Model / TMdl Editing

Postby StingRay68 » Mon Dec 12, 2016 1:46 pm

Disclaimers :

MoRE still has plenty of bugs, it is a work in progress.
If you're willing to put up with a few headaches in order to experiment with tmdl editing, then by all means, have at it. If you're easily irritated, frustrated etc, this isn't for you.

Not everyone is going to be able to do this, and I am not providing tech support.

Editing a TMdl is still quite involved. In my opinion, only experienced modders should try tackling this. It is beyond the scope of this thread to explain the basics of madden modding.

Editing a TMdl will require usage of other utilities :

JDhalfrack's DFR (Dat File Replacer).

* Just a side rant here, when using DFR you should ALWAYS use zero based arrays.
The database (roster/franchise) files all begin their counts with 0. It doesn't make sense to have to adjust your numbers by 1 when trying to import/export a specific file number that is referenced in the database files. I wish JD had made the zero based arrays the default display, instead of an afterthought. (But, as always, thanks for making it, JD )

You will also need to understand how to properly decompress a tmdl file, which involves using JDs MUER (Madden Uniform Editor and Ripper)
Hint : A lot of you don't. Most of the time when someone sends me a TMdl file I have to fix it.
* oh no, more rants. Just because a file "works" doesn't mean it is correct. Also just because a file "works" isn't proof of a concept either.

If you use MoRE to try to load and/or edit DATs I am not currently discussing, or have previously discussed in this thread, you may have issues.

Before asking a question, please read through the thread and make sure your question hasn't already been answered.

Please do NOT start separate threads about MoRE usage and/or bugs.

I'm not interested in discussing texmod usage or what the proper dimensions of any given model/graphic should be. If you want to argue those points, there are other threads that deal with those topics.
If you want to truly customize madden, you should get familiar with both texmod and dat editing.
You cannot edit a model with texmod.

User avatar
StingRay68
Hall of Fame
Posts: 1073
Joined: Mon Jan 09, 2012 7:23 pm

Re: Model / TMdl Editing

Postby StingRay68 » Mon Dec 12, 2016 1:53 pm

What models can be edited : PC Madden 2004-2008 files only.
Fieldart - yes

Stadiums - These can be loaded and the data displayed. Editing... maybe/maybe not, we'll get to it later.
Player/Coach models - Not yet. This will probably be possible, but I have no idea on the timeframe.


Possible future options :

Usage of CSV values for importing/exporting the coordinates.
This would make editing a complex model a lot easier to be able to see these values in some sort of spreadsheet type file.

Importing/Exporting models made with "brand x" software modeling program ?
I am not sure about this. The software would have to be free and the saved files would have to be very easy for me to figure out.
Honestly, since madden has it's own custom method of using the coordinates, this is most likely not something I am going to try to provide support for.


Being able to truly customize a model would require a better MMAP editor than what is currently available. Again, I have no idea on the timeframe.

User avatar
StingRay68
Hall of Fame
Posts: 1073
Joined: Mon Jan 09, 2012 7:23 pm

Re: Model / TMdl Editing

Postby StingRay68 » Mon Dec 12, 2016 1:57 pm

MoRE Usage : For PC Madden versions 2004-2008

There are 2 versions.
One uses .net 4.5.1 which is for Windows 7.
The other uses .net 3.5.1 which you want if you are using Windows XP
*Sorry in advance, but I cannot comment on compatibility with Windows Vista, any of the Windows 8 versions, or Windows 10, I don't run any of those OS.

MoRE 1.0 for Windows 7
MoRE 1.0 for Windows XP

MoRE 1.02 for Windows 7
MoRE102.zip
(142.02 KiB) Downloaded 192 times



Example TMdl files used

NOTE :
When editing a cell of the datagrids (mainly the geometry) you MUST leave the cell in order for the change to be completed.
If you change a specific cell and do not click somewhere else, when you save the file, the last cell you were attempting to change will not be saved.

User avatar
StingRay68
Hall of Fame
Posts: 1073
Joined: Mon Jan 09, 2012 7:23 pm

Re: Model / TMdl Editing

Postby StingRay68 » Mon Dec 12, 2016 1:59 pm

The Screen :

Speaking about the screen, the coordinates in madden are laid out like this:
The center of the screen is 0,0
Anything left of center is -x, right of center is +x
Anything above center is -y, below center is +y

screen-breakdown.jpg
screen-breakdown.jpg (113.8 KiB) Viewed 4089 times

User avatar
StingRay68
Hall of Fame
Posts: 1073
Joined: Mon Jan 09, 2012 7:23 pm

Re: Model / TMdl Editing

Postby StingRay68 » Mon Dec 12, 2016 2:07 pm

Let's begin by discussing the Fieldart.dat
This DAT is fairly straight forward and not overly complex.
Most of those models consist of rectangles/squares in various locations on the screen.

default-edit.jpg
default-edit.jpg (200.35 KiB) Viewed 4089 times


I've loaded a tmdl from the fieldart.dat that elguapo previously sent me.
In the left pane there is basic info about the tmdl. There is 1 "shape" in this model.

The right portion of the screen holds most of the guts the tmdl.
The triangles section holds a series of coordinates that make up triangles. Triangles are used to make the shapes that are rendered in the model.

The Extn section is basically the top left coordinate and bottom right coordinate of each shape and there is also one master entry that is the maximum top left and bottom right for all of the shapes combined.
* Do not edit these, unless you have to, or want to experiment. The editor adjusts these as necessary.

The material section contains the name of each shape and the graphic processing for the texture it uses and the name of the texture it applies to that model. The texture is normally listed in the MMAP file.
* Do NOT simply insert a different custom mmap into a given TMdl file. If the MMAP textures names do not match the texture names given in the TMdl, there will be conflicts from either not having a texture or an unintended texture being used.

The Geometry section includes the coordinates for each point of the triangle, as well as how to align the texture to the coordinates. The coordinates are basically yardage markers on the field.

User avatar
StingRay68
Hall of Fame
Posts: 1073
Joined: Mon Jan 09, 2012 7:23 pm

Re: Model / TMdl Editing

Postby StingRay68 » Mon Dec 12, 2016 2:20 pm

In the previous example, the material section is referencing the graphic called "Map__1" in the mmap of this model.
This graphic is processed with "OnePass" which is likely some form of filtering.

The texture being used is the NFL shield emblem on the field.

There also exists another material called "lambert 1", this has a process called "Flat" and it does not use a texture in the mmap portion of the file. I do not know what the material/process does, but it is unimportant for this tutorial.

Ok, so we look at our triangle section. There is going to be 2 triangles for each square/rectangle.
Triangle 0 uses geometry coordinates of 2, 1, 0
and triangle 1 uses 1, 3, 0

Looking at the geometry section we can see that all the coordinates for points 0-3, the x and y coordinates are all negative.
Referencing our screen diagram, this is going to be placed in the top left section of the screen.
Im not drawing this, but these coordinates are laid out like:

2 0
1 3

User avatar
StingRay68
Hall of Fame
Posts: 1073
Joined: Mon Jan 09, 2012 7:23 pm

Re: Model / TMdl Editing

Postby StingRay68 » Mon Dec 12, 2016 2:24 pm

Looking at geometry still, in the Tex H and Tex V (Texture horizontal and vertical) sections we see values of near zero or near 1. (this should really be exactly 0 or 1 for this tutorial, so when I end up editing these I will make them exact)

This defines how the texture from the mmap is going to be displayed.Where H is 0, the pixel is the left most and 1.0 the rightmost
where V is 0, the pixel is the top most and 1.0 the bottom most.

In the mmap the shield is laid out vertically, so the top is at the top, etc
shield.jpg
shield.jpg (9.05 KiB) Viewed 4086 times

In the model
For Point 1, the value is basically 0 for H and 0 for V which is the top left of the graphic.
For point 2, the value is basically 1 for H and 0 for V which is the top right
For Point 0, the value is basically 1 for H and 1 for V which is the bottom right
For Point 3, the value is basically 0 for H and 1 for V which bottom left

Again, the layout in the TMdl is
2 0
1 3
smallrotatedshield.jpg
smallrotatedshield.jpg (3.5 KiB) Viewed 4081 times

So this graphic would be rotated 90 degrees to the left, which would be pointing towards the left endzone on our screen from before.

User avatar
StingRay68
Hall of Fame
Posts: 1073
Joined: Mon Jan 09, 2012 7:23 pm

Re: Model / TMdl Editing

Postby StingRay68 » Mon Dec 12, 2016 2:29 pm

so according to the diagram I typed out, this graphic should be oriented facing the endzone on the left side of the field.
It's not the the best capture, but you can sort of see in the following pic, that the shields are all facing the closest endzones.

normal.jpg
normal.jpg (92.33 KiB) Viewed 4086 times


Return to “Development”

Who is online

Users browsing this forum: No registered users and 4 guests