HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

MDX Format

09-08-2002, 08:08 PM#31
Guest
Where can i get the most *full* description of mdx format for the current moment?
09-08-2002, 09:11 PM#32
Nub
Uhm, well Daishi and I have a informal mental list of things that KMK's doesn't cover but KMK's is the best and more or less only. The PRE2 spec I posted above is pretty good as particles are really one of the coolest things we can fully edit in the mdx format. There are many other things that are stranger and we haven't covered. I haven't been able to sit down and hash out the list of stuff we figured out, but we may be able to make one eventually. For now: Z is up, learn Bezier and Hermite curves for animations, and the Anims entries are lighting (Daishi's discovery).
09-08-2002, 10:12 PM#33
Guest
KMK has a spec. It's nice, but not full. I wonder, where can i get such a spec-file, but more complete.

Also, i'm StarCraft 3D project leader from www.starcraft3d.com (isn't much fucnctioning yet:( ) and i just need MDX routines to learn and to invet own model format for our game/engine.
09-09-2002, 02:30 AM#34
Darky
i am completely lost. wouldn't making the min extent and the max extent of an animation stop the animation altogether? That is the no. 1 problem I am having with my animation edtor.
09-12-2002, 02:16 PM#35
BlacKDicK
Code:
TEXS
	long	nbytes
	struct {
		long	ReplaceableID;
		ASCII	TexturePath;	(0x100 bytes)
		long	???;		(Changed a lot without results. Maybe TextPath is 0x104??)
 		long	Flags;		(0x1=WrapWidth,0x2=WrapHeight,0x3=Both)
	} textures[ntexs];



struct Modl{
	long	nBytes;
	char[0x50]	Model;		(0x50 with ending)
	char[0x100] AnimationFile;	(0x100 with ending)
	long	unk1;			(Changed a lot without results.
					(Maybe AnimationFile is 0x104 or 0x108??)
	long	unk2;			(0)
	float	MinExtx, MinExty, MinExtz;
	float	MaxExtx, MaxExty, MaxExtz;
	long	BlendTime;
}


Also, on KGSC, KGTR and KEVT the 0xFFFFFFFF is actually GlobalSeqId. 0xFFFFFFFF means empty GlobalSeqId.

Code:
KGTR:Translation
	long	nunks;
	long	LineType;				(0:don't interp;1:linear;2:hermite;3:bezier)
	long GlobalSeqId (0xFFFFFFFF means none )
	struct { (We should name this struct maybe "KGSubitem" )
		long	???;(I guess it is Time, maybe msecs)
		float	x, y, z;
		if (LineType != 1) {
			float	InTanx, InTany, InTanz;
			float	OutTanx, OutTany, OutTanz;
		}
	} unknown[nunks];
09-12-2002, 03:15 PM#36
Nub
Min extent and max extent have nothing to do with animation. They have to do with lighting. ALL the animation occurs in the bones in the form of Linear, Hermite, and Bezier curves. The long is in frames, the scale of which I'm note sure how many frames per sec the animations occur at.
09-13-2002, 09:42 AM#37
KMK
I was pretty sure min and max extent were the minimum and maximum point of the bounding box, I guess that could be to do with lighting, do you know how in particular?
09-13-2002, 10:54 AM#38
BlacKDicK
Code:
MTLS
	long	nbytes;
	struct {
		long	nbytesi;
		long	PriorityPlane;
		long	Flags; (+1=ConstantColor, +2=no results so it seems to be bool)
		LAYS
	} materials[nmtls];


LAYS
	long	nlays;
	struct {
		long	nbytesi;
		long	FilterMode;			(0:none;1:transparent;2:blend;3:additive)
		long	Shading;			(1:unshaded;+16:two sided;+32:unfogged)
		long	TextureID;
		long    TVertexAnimId;			0xFFFFFFFF=None
		long	CoordId;			(0=None)
		float	Alpha;				(0(transparent)->1(opaque))

		(KMTA)

	} layers[nlays];
KMTA
	long	nunks;
	long	LineType;				(0:don't interp;1:linear;2:hermite;3:bezier)
	long GlobalSeqId (0xFFFFFFFF=None)
	struct {
		long	???;
		float	State;				(0 or 1)
		if (LineType > 1) {
			float	InTan;
			float	OutTan;
		}
	} unknown[nunks];

09-14-2002, 08:24 PM#39
Darky
if (LineType > 1) {
float InTan;
float OutTan;
}
so if i set all of these to 0, the animation shouldn't occur, correct?
09-17-2002, 04:46 AM#40
AquaDaishi
My min/max lighting hypothesis has yet to be tested, but you can kind of see what I'm talking about if you look at the Gnoll Warden at a side angle in the WE (you'll notice shadows, which I think that it would be beyond the capabilities of our current graphics cards to do that kind of ray casting shadowing type rendering for 1000+ vertices per model for EVERY frame of animation). So the min/max extent acts as a scaling ratio for the vertices for the VERTEX animation(i.e. the vertices moving inside a GEOS object, we have yet to figure that beast out...), while the Min/Max extent for the GEOS object would again act as a hierarchial (sp?) scaler, and so forth for the entire model's min/max extent.

If it was just a bounding box, then why make little bounding boxes inside a biger bounding box?

Of course, someone could probably test this out quite simply.. try making the min/max extent a really big number ( I can't test it since my war3 doesn't work on the computer that I code on ).

That was a lot of typing... Hope that cleared something up.

-Fredric
09-17-2002, 11:41 AM#41
KMK
These are the uses of min/max extent
1) MODL: the extents of the entire model across all frames
2) SEQS: the extents of the entire model during each sequence
3) GOES: the extents of the individual geoset during the whole animation and during each sequence

It could be to speed up rendering, by giving the region to render. I gave it a test with decreased extents and the world editor wouldn't accept it, i got an error about not being able to load the mdl file and instead of the model i got a checkered box.
09-19-2002, 06:02 PM#42
AquaDaishi
Well, I figured out how the translations work with the intan/outtan crap. =)

The 'intan' is a reference to the TANGENT line of curve of the starting location. It's in unit vector notation.

Same with the 'outtan', but it's the TANGENT line of the curve at the final location.

-Fredric
10-20-2002, 06:37 AM#43
Xaran Alamas
where can I find YobGul's War3 File Converter?
10-20-2002, 05:57 PM#44
Guest
http://www.wc3campaigns.com/modules....download&cid=2
It is just called "War3FileConverter" and its about half way down the page.

When the MDX loads textures (not sure if load is the right word). And lets say it has 7 textures, and it has 7 materials. Now in the MDL file, when it says "static TextureID 0" does that correspond the the first texture loaded, or the last one? Is there any sequence? Thanks.

EDIT:
Colors go like this in the MDL file (with war3fileconverter)
BGR (Blue, Green Red). Each of those numbers will be <= 1, so to get the regular value (0-255) just multiply it by 255.
In the MDX file (opened with a hex editor), the values go RGB. If you want to search for a decimal you saw in the MDL file, look for a 32bit float.

If you are working with Hex Workshop, go to Tools -> Base Converter and you can convert from Float <-> Hex
10-21-2002, 11:51 PM#45
Guest
Uhhh, scratch using the base converter. Just hit CTRL+F and type in the value as a 32 bit float and it will give you it in hex.

EDIT: I just realized this info was already posted :(