Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Necromancy: New import/export tool for KOTOR 1/2 request

Post questions about game models here, or help out others!
Post Reply
User avatar
Hairless Wookiee
beginner
Posts: 24
Joined: Wed Oct 26, 2011 12:05 pm
Been thanked: 1 time

Necromancy: New import/export tool for KOTOR 1/2 request

Post by Hairless Wookiee »

Is there anyone interested in taking a crack at coding a new compiler/decompiler for the MDL format used by Knights of the Old Republic (KOTOR) 1 and 2? There is an existing Perl-based tool, MDLOps, that can decompile and recompile the format, but it has always been fairly broken/buggy and it is limited in what it can do. MDLs that are decompiled into an ASCII format by MDLOps can be loaded with NWMax, a GMax/3DS Max import/export script for Neverwinter Nights (KOTOR 1/2 uses the Odyssey engine, a console variant of NWN's Aurora). I figure there is no need to reinvent the wheel as far as an import/export script goes, although if someone is that keen then by all means go ahead.

I know the games are fairly ancient now, hence the title, but there is still a small active modding community. A new, fully functional model tool would be a fantastic boost and enable a lot of stuff that has not been possible in the past. I'm trying to get some new custom models into the game, but for a number of them I just can't get MDLOps to compile them properly. They either cause the game to freeze/crash, or end up with wild distortions/mesh displacement. Hence this request.

If anyone is interested, here is a partial breakdown of the binary MDL format by the original MDLOps author cchargin - https://home.comcast.net/~cchargin/kotor/mdl_info.html

The original MDLOps tool is available here - https://home.comcast.net/~cchargin/koto ... s0-5-0.zip

An updated version by JDNoa is available here - http://www.starwarsknights.com/mtools/mdlops06a1.zip

NWMax is available here - http://neverwintervault.org/project/nwn ... ol/nwmax-8

Mods: I know the rules forbid posting of model samples, but is it ok to supply them via PM/email on request? Otherwise I guess I am limited to hex snippets?
JohnBarleycorn
n00b
Posts: 11
Joined: Fri May 29, 2015 5:42 pm

Re: Necromancy: New import/export tool for KOTOR 1/2 request

Post by JohnBarleycorn »

*I AM* definitely interested. Alas, like you, time ago i was trying to import some models in Kotor (1&2) but there was some issue with the importers/exporters. There is people who did get his models into kotor, becouse i've seen lot of mods around, but i can't find a valid tutorial and working tools by now. That's really too bad, since even if those games may be "ancients" but they still rock. After all, their "heir" should be SWTOR which is not even worth considering...
Szkaradek123
mega-veteran
mega-veteran
Posts: 292
Joined: Wed May 05, 2010 8:21 pm
Location: Poland Głogów
Has thanked: 21 times
Been thanked: 742 times

Re: Necromancy: New import/export tool for KOTOR 1/2 request

Post by Szkaradek123 »

Hi
Here is a blend for import meshes with vertex weights and animation.
It is important don't convert skin to trimesh from kotor tool.
Some mesh data after using KotorTool is corrupted. Missing vertex weights, rotation keys are totally wrong.

It requires installed Blender249 and Python 266 (all 32 bits).
How use:
-doubleclick Blender249.blend or copy all files to folder where is blender.exe and doubleclick Blender249.blend
-in Blender Text Window press alt+p and select ascii mdl file for meshes.

If this file has animation data => importer extract animations into new folder with name ..._animfiles

-if you want to get right position of head, import body=>SELECT ARMATURE IN BLENDER 3D VIEW=>import head=>press PLAY ANIMATION for short time
-for animation=>SELECT ARMATURE IN BLENDER 3D VIEW=>press alt+p to import *.anim file from folder with name ..._animfiles
Animation works for me only with p_hk47 and p_zaalbar from KOTOR and some others models. Not to all.

Thanks to lyutor1945 for help , models and idea to make this script.

Script is not perfect . Please report bugs.

Animation example:
http://www.mediafire.com/download/c9pia ... hk47.blend
You do not have the required permissions to view the files attached to this post.
TRDaz
mega-veteran
mega-veteran
Posts: 215
Joined: Sat Sep 24, 2011 7:06 pm
Has thanked: 78 times
Been thanked: 32 times

Re: Necromancy: New import/export tool for KOTOR 1/2 request

Post by TRDaz »

Awesome work on the blender script!
There is another game from Bioware that seems to be the same format as KOTOR, which is Jade Empire. MDLOps doesn't work with it, and your script doesn't import anything. Is there any way to import these models too? I really would like them. I uploaded a few samples. I hope you can check these out.
You do not have the required permissions to view the files attached to this post.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4289
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1150 times
Been thanked: 2243 times

Re: Necromancy: New import/export tool for KOTOR 1/2 request

Post by shakotay2 »

*.mdx: first submesh only - it's a little bit tedious to get the second one:
n_dawn.jpg
You do not have the required permissions to view the files attached to this post.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
TRDaz
mega-veteran
mega-veteran
Posts: 215
Joined: Sat Sep 24, 2011 7:06 pm
Has thanked: 78 times
Been thanked: 32 times

Re: Necromancy: New import/export tool for KOTOR 1/2 request

Post by TRDaz »

Nice! I am able to use hex2obj so I may try that way, but if there is any way to get a blender importer with bones and weights I would love that more.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4289
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1150 times
Been thanked: 2243 times

Re: Necromancy: New import/export tool for KOTOR 1/2 request

Post by shakotay2 »

TRDaz wrote:but if there is any way to get a blender importer with bones and weights I would love that more.
guess Mariusz will care for that sooner or later if the model format is not too different.
There's .mdl and .mdx files in both games? Would be nice to have their structures compared.

(I'll see whether I can get the skeleton from the n_dawn_.mdl file.)
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
TRDaz
mega-veteran
mega-veteran
Posts: 215
Joined: Sat Sep 24, 2011 7:06 pm
Has thanked: 78 times
Been thanked: 32 times

Re: Necromancy: New import/export tool for KOTOR 1/2 request

Post by TRDaz »

Yes I do believe both games have .mdx and .mdl, and there is a tool to compile them both into a different .mdl. I can try and get a .mdl and .mdx file from either of the KOTOR games (I have those games too).

EDIT: Here are 2 sets of mdl and mdx files from KOTOR 2.
https://www.sendspace.com/file/ggl1p1
TRDaz
mega-veteran
mega-veteran
Posts: 215
Joined: Sat Sep 24, 2011 7:06 pm
Has thanked: 78 times
Been thanked: 32 times

Re: Necromancy: New import/export tool for KOTOR 1/2 request

Post by TRDaz »

Any help with a script for those? I did find this post about the model format of the mdl's in Jade Empire if it's of any help: http://www.lucasforums.com/showpost.php ... stcount=51
Naionel
ultra-n00b
Posts: 2
Joined: Sat Jan 02, 2016 8:46 pm

Re: Necromancy: New import/export tool for KOTOR 1/2 request

Post by Naionel »

Hi guys,

I have to ask you about MDLops - I've tried to contact almost every, single forum i could, but all links have been expired. Could someone of you give me that file? I need it in order to get the models from the game (as you obviously know). Thanks for help!
Acewell
VIP member
VIP member
Posts: 1330
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2710 times
Been thanked: 884 times

Re: Necromancy: New import/export tool for KOTOR 1/2 request

Post by Acewell »

I would just say go to StarWarsKnights.com but the site is down and has not had a snapshot since November 6th, fortunately the archived links still work. Get it while its hot!

http://web.archive.org/web/201511062222 ... /tools.php
Naionel
ultra-n00b
Posts: 2
Joined: Sat Jan 02, 2016 8:46 pm

Re: Necromancy: New import/export tool for KOTOR 1/2 request

Post by Naionel »

Wow! That's amazing, thanks!
Post Reply