• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Using Blizzard mdl/mdx in XNA

Status
Not open for further replies.
Level 24
Joined
Aug 1, 2013
Messages
4,657
Hi all.
I am working on a nice 3d game a bit based on Super Smash Bros Brawl (Sora), Lost Magic (Taito) and World of Warcraft (Blizzard).

I am really excited of this game but I have no good/enough resources of models, textures and pictures.
As WC3 has this massive amount of those, I thought "I can use these as basic models."
(I will not release this game with WC3 models though, but I have to have something to show of to get some real game artists work on it.)

But after all, WC3 uses Blizzard custom file types (.mdl/.mdx) and as a 0 experienced moddeler, I don't really know how to be able to use them.

Can anyone enlighten me by wether I CAN use them or not and if yes, how can I use them?

Thanks in advantage.

- Wietlol
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Sorry but I am pretty new to programming and this is in fact my first C# project. (I have done a few good Java projects but nothing more.)

Also the code that you linked to is not very similar to full classes in C# (as far as I know)
Could you upload an example project where you just show one simple model and his animation?

(I can make 2d games but people keep saying that I should start making 3d games.
They become annoying after 2 years.)
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
In that case, you might want to delay custom models for now, since they require you to know how to write and use code for your GPU, aside from C# itself.

If you still want to, start simple - create a binary reader, read just the geosets chunk, and then work on getting them rendered.
Once that is done, you can continue to more advanced things, like textures and animations.

For this you'll need to know how to use vertex and index buffers, how to draw primitives with them, and possibly how to write HLSL shaders.
From a little googling, this seems like a good place to start.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
You can easily load any required textures (or whatever they are really called) by pre-converting them. Use a blp converter tool to turn them into a standard file format then you can use something like DirectX Texture Tools to convert them into .dds files (yes the same .dds as SC2 uses). You should find native classes to read in .dds files as part of the SDK/standard libraries since the file format was developed by Microsoft. The only disadvantage of this is that you cannot use jpeg style compression although there are other forms of compression available to you that are easier to load.

Do note that Direct3D calls required to generate "3D graphics" can be quite computationally intensive and block for extended periods of time due to underlying I/O with the GPU. It is recommended to try and run them on a separate thread with the main thread only synchronizing the necessary state (positions, animations etc). This way the processor can both be advancing game state and rendering an output frame at the same time. Obviously it is not that simple to do but is pretty common practice now (SC2 uses it as an example) and is a good way to take advantage of multi-core systems.
 
Status
Not open for further replies.
Top