Allegiance MDL file library for .net

Discussion area for user-created Allegiance models, textures, voicechats, music, and other ingame content.
Your_Persona
Posts: 773
Joined: Sat Dec 04, 2004 8:00 am
Contact:

Post by Your_Persona »

Looking for testers and contributors on the following project

https://code.google.com/p/allegiance-mdl-file/

Today I ran this library against all the files in my current artwork directory and got the following results.

Successfully read 3129 Binary MDL files
Skipped reading 165 text MDL files

Errors on the following files:
animinvest.mdl
animlaunch.mdl
animloadout.mdl
animradar.mdl
animsector.mdl
animteam.mdl
cap503.mdl
cube.mdl
font.mdl
gataaranbmp.mdl
ss106.mdl

----

I have almost finished porting all of the loading code from MDLC.exe to get this far. Obviously there are a few methods left to port.
Once that is finished, we can start porting the saving methods.

As for the loading methods, there are a few IFunction:Read and IFunction:Apply that still need to be done. I expect that this will fix the rest of the files that had errors.
If you find any implementation of IFunction in the source for MDLC, then that will be the complete list of what is possible.

I recommend running MDLC.exe with the -Info command against some file, and placing breakpoints on the methods (ReadApply, and ReadBinary) in mdlbin.cpp.
Then stepping into the function pointers call to ->Read() or ->Apply() and make sure there is a corresponding method in the .Net project to perform that action.

So we are 99.648% of the way there for reading existing binary MDL files. (Hopefully the ones that have exceptions aren't just corrupt!)
And no bytes are being tossed during the loading, so being able to edit and save will be possible.

Anyone interested?

Looking for testers and contributors
https://code.google.com/p/allegiance-mdl-file/
Last edited by Your_Persona on Tue Feb 28, 2012 5:34 am, edited 1 time in total.
-->>Elitism<<--
I'm not Hamlet. I don't take part any more. My words have nothing to tell me anymore.
madpeople
Posts: 4787
Joined: Tue Dec 16, 2003 8:00 am
Location: England

Post by madpeople »

Your_Persona wrote:QUOTE (Your_Persona @ Feb 28 2012, 05:32 AM) animinvest.mdl
animlaunch.mdl
animloadout.mdl
animradar.mdl
animsector.mdl
animteam.mdl
These are animations. I don't know if mdlc adds any data / sets any flags in the mdl when it encounters an animation (presumably it recognises animations by the fact they aren't square and their sizes aren't powers of 2 - and not by the fact they are prefixed by 'anim'?).
QUOTE cap503.mdl[/quote]I don't see anything special about this one, maybe a buggy mdl file? I would doubt it since I think it's an MS one
QUOTE cube.mdl[/quote]I don't know what this is
QUOTE font.mdl[/quote] This is a binary file containing the information on what fonts to use for what "sytles" of text (different parts of the code and other mdls reference styles, this maps sytles to fonts, and also contains the glyphs for the fonts allowing non-standard fonts http://www.freeallegiance.org/FAW/index.php/Font.mdl
http://www.freeallegiance.org/FAW/index.ph...definition_file
QUOTE gataaranbmp.mdl[/quote]odd, this isn't in my converted artwork. I don't know what this is
QUOTE ss106.mdl[/quote]same as cap503


Have you poked around https://faz.svn.codeplex.com/svn/branch ... nce/MDL.cs ?
Your_Persona
Posts: 773
Joined: Sat Dec 04, 2004 8:00 am
Contact:

Post by Your_Persona »

Thanks for the info MP.

And yes, I have looked at and used KG's MDL.cs It's pretty good stuff, I use it in MDLUtility2. However it is not complete, and discards some information that is needed to be able to save correctly.

I initially started with trying to make MDL.cs do what I needed but found it would take to long and just decided to copy what allegiance was doing.
-->>Elitism<<--
I'm not Hamlet. I don't take part any more. My words have nothing to tell me anymore.
madpeople
Posts: 4787
Joined: Tue Dec 16, 2003 8:00 am
Location: England

Post by madpeople »

madpeople wrote:QUOTE (madpeople @ Feb 28 2012, 10:10 AM) QUOTE cube.mdl
I don't know what this is
[/quote]
I lie, cube.mdl is probably a cube.
I imagine it was converted from: http://svn.alleg.net/svn/AllegArt/branch/FAZDev/256/cube.x
This is probably the texture: http://svn.alleg.net/svn/AllegArt/branch/F...56/cubetext.mdl
Here you have a nice simple test object to compare saved things to (assuming cube.mdl is a valid mdl - see if it loads in mdledit).

QUOTE However it is not complete, and discards some information that is needed to be able to save correctly.

I initially started with trying to make MDL.cs do what I needed but found it would take to long and just decided to copy what allegiance was doing.[/quote]
I approve :)
Last edited by madpeople on Tue Feb 28, 2012 7:50 pm, edited 1 time in total.
Imago
Posts: 1440
Joined: Tue Sep 23, 2003 7:00 am
Location: Minneapolis, MN
Contact:

Post by Imago »

ok good, madpeople approves. you may continue working on this now.

/troll
Image

These bugs haven't been fixed yet because don't have any developers interested in fixing them up. --Tigereye
Imago's stupid-sensor is supersensitive. --RealPandemonium
The art is managing the flow of the drama to achieve the desired results. --Big_Beta_Tester
joeld wrote:But we’ve been amazed at the level to which some of the Allegiance fans have remained hard-core.
Compellor
Posts: 994
Joined: Fri Jul 06, 2007 12:56 am
Location: Columbus, OH

Post by Compellor »

.

Thought I saw something reliant but I was wrong.
Last edited by Compellor on Thu Mar 01, 2012 1:50 am, edited 1 time in total.
Any job worth doing with a laser is worth doing with many, many lasers. -Khrima
Beyond a shadow of a doubt if you don't watch them like a hawk they will stack their collective balls off - MrChaos on Alleg players
Your_Persona
Posts: 773
Joined: Sat Dec 04, 2004 8:00 am
Contact:

Post by Your_Persona »

I added support for the anim*bmp.mdl files.

The image loading part has a bug in it though, some of the frames come back a little scrambled. Anyone who understands images want to give that part a peek?
-->>Elitism<<--
I'm not Hamlet. I don't take part any more. My words have nothing to tell me anymore.
Adaven
Posts: 1959
Joined: Sat Oct 25, 2003 7:00 am
Location: Greater Ozarks

Post by Adaven »

For someone who has never touched .Net, how can I use this? For instance, how can I create text mdls for existing binary models? I'd like to be able to view them manually to help my own understanding of the format and for figuring out what I can of the original tool chain.

I've got Visual Studio (although I've almost never used it) and I can see your unit test where you load up fig20.mdl from the Alleg art directory. How would I go about writing that model out to text?
Your_Persona
Posts: 773
Joined: Sat Dec 04, 2004 8:00 am
Contact:

Post by Your_Persona »

Adaven wrote:QUOTE (Adaven @ Mar 18 2012, 10:53 PM) For someone who has never touched .Net, how can I use this? For instance, how can I create text mdls for existing binary models? I'd like to be able to view them manually to help my own understanding of the format and for figuring out what I can of the original tool chain.

I've got Visual Studio (although I've almost never used it) and I can see your unit test where you load up fig20.mdl from the Alleg art directory. How would I go about writing that model out to text?

ATM it doesn't have a method to output the text-mdl. You can only see it in the debug window.

I'll move that code to a method you can call and give an example of passing a file to it from the command line and catching the text-mdl output.
-->>Elitism<<--
I'm not Hamlet. I don't take part any more. My words have nothing to tell me anymore.
Your_Persona
Posts: 773
Joined: Sat Dec 04, 2004 8:00 am
Contact:

Post by Your_Persona »

Your_Persona wrote:QUOTE (Your_Persona @ Mar 19 2012, 07:08 PM) I'll move that code to a method you can call and give an example of passing a file to it from the command line and catching the text-mdl output.
I have updated the code and added a new console project that decompiles binary mdl files to text mdl files.

Code: Select all

mdld.exe /file:"pathToBinaryMdl.mdl" /out:"pathToOutputText.mdl"
   Reads from a source files and creates and output file.
or
mdld.exe /file:"pathToBinaryMdl.mdl" 
   Reads from a source file and writes to stdout
or
mdld.exe 
   Reads from stdIn, and writes to stdOut
-->>Elitism<<--
I'm not Hamlet. I don't take part any more. My words have nothing to tell me anymore.
Post Reply