I was wondering if anyone has ever written a model viewer for KotOR, or if not, whether information on the model file format is available, so I could more easily write it myself.
I'd rather not spend my time reverse-engineering the format if someone else has done it already.
_________________
I was wondering if anyone has ever written a model viewer for KotOR, or if not, whether information on the model file format is available, so I could more easily write it myself.
I'd rather not spend my time reverse-engineering the format if someone else has done it already.
_________________
GMax(Free) and 3dsMax($$$) can open the files if you convert the model files (.mdl and .mdx) you get from KTool into an -ascii.mdl file using MdlOps, and using the NWMax plugin for GMax or 3dsMax, you can bring the models into GMax/3ds. Then you have to select the parts of the body/head/whatever (usually clearly marked as head, hair, body, larm, rarm, etc. In GMax, to select them, the hot key is H and use control to select more then one.) then apply the skin to the body/head/whatever (in gmax, hotkey is M. Select Metal as the Shader, press the gray box next to Ambient/Difuse, and select the texture file) And there you go, you have your texture. Its probably not going to be the best quality or the quality it will have in game, so don't worry. In 3ds, I've heard that to get the best idea of your texture, you can use the rendering feature. But GMax doesn't have that feature standard, so you'll have to surf the net for the rendering plugin download.
Well, as it seems there is no stand-alone model viewer, I just wrote one myself.
Here are a few sample images - just picked some random models from KotOR and KotOR2.
The viewer is not 100% ready - there is a handful of models that do not look right, and there are some things I would like to add, but I need information from BioWare for that.
"Beware the form-fitting black armor-clad Drow hottie with twin Mineral II Greensteel Khopeshes!"
"Liella d'Orien says, '"You're the fool, Devil. -- Witness the power of this fully ARMED and OPERATIONAL Titan!"'"
People have been wanting something like this for quite a while!
Kudos!
Looking for a reliable place to host your KotOR and TSL mods? Look no further than KotORFiles!
We have a great team, who will be sure to get your mod uploaded ASAP, after you submit. We also get 1000's of visitors every day, so your file is sure to get noticed!
You can watch my KotOR and TSL video's on YouTube!
Those screenshots are pretty inspiring Adinos, nice job so far! It's been a long time since since we've seen new mod tools around here. Make me nostalgic.
Works-In-Progress
~ Mods Released
~ Website
~ Jallama Reed is the New Pioneer. Jallama Reed is Life Under Siege. Jallama Reed is the Model of Tragedy. Jallama Reed is the Avatar of Us All.
Well, I have to fix a couple of things before I am comfortable with releasing this. There are three models that don't look right - something wrong with the textures, and a few more models where the lighing doesn't look right, as if the normals are reversed or something. I should get this finished next week, though.
Well, I have to fix a couple of things before I am comfortable with releasing this. There are three models that don't look right - something wrong with the textures, and a few more models where the lighing doesn't look right, as if the normals are reversed or something. I should get this finished next week, though.
Just out of interest: Do you need to compile the models with MDLops first or do you use something you wrote for yourself to read the Binary models.
If you use MDLops, well you're bound to run into some troublesome models.
Its a good program, but it looks like it can't do certain models without faults in them.
I read the binary MDL/MDX files. Easy enough for KotOR and KotOR2, but I wanted to handle Jade Empire too, as that file format is quite similar, but I am having some trouble there. If I cannot solve it, I'll just release the viewer as it is.
I read the binary MDL/MDX files. Easy enough for KotOR and KotOR2, but I wanted to handle Jade Empire too, as that file format is quite similar, but I am having some trouble there. If I cannot solve it, I'll just release the viewer as it is.
Wow, so you know whats in there and what all the fields thingies, etc of the meshes ?
See my friend GloveMaster is trying his best to figure it all out and he has plans to spend his summer on getting MDLops finished.
The little program can do a lot already, but certain fields in the mdl and mdx are unknown what they do, what they are and so on...
Where thinking about lightmaps, we need find a way to get things in the second channel of a 3D mesh for that... well and theres the animation bit aswell
Anyway, to cut my jibberish short, perhaps you could help GloveMaster out on develloping a good little tool that can handle everything 3D modelwize for the kotor games... that would be such blast !
A question Adinos; since this viewer can read binary models, will it be able to show edited models? (you add a set of horns to a head, you make the model files, and your viewer will be able to view your edited model just like other models?)
OK, I made a small addition that might be useful - the ability to see how a different texture would look on the model.
This screenshot shows three instances of the viewer running - the first is the original, the second shows the texture replaced with a different one, where the blue has been changed to red, and the third is mostly for fun .. shows the model in wireframe mode.
Now, I'm not quite ready to release this officially yet - there are still a few bugs that remain, but if anyone wants to be a beta tester, drop me a note - PM Me Your Email Please, and I'll send you the current version.
Snipped email address as per our posted rules. It keeps away the spam bots. Please use Private Messages (PM) to exchange this info instead. Thanks. -RH
Hello, thanks to Marius, who handed over a copy of your little program, I gave it try and its pretty neat.
I've peeked at some creatures and character model, but also tried some of my own area models.
It all seems to work
EDIT: Sometimes though I need to alter the background color, or the rotation speed to get the rendering back.
Often I just get an empty window, showing my desktop.
And now and then I encounter the black models, most of my weapon models are so... though they appear ok in the game.
Its weird
Makes me happy I can check my area models without starting the game all the time.
Though perhaps on that specific topic, area models.
Would it be possible to implement a zoom function, so I can get closer
Or better, a full moveable camera; though that might be to much to ask.
Its seems to run smoothly on my PC, though a bit quircky, if another window or program passes over it, the rendering seems to go faulty a bit.
Anyway great job, I hope you continue to work on this
Well, this is a beta, so there are still some bugs - and this is the very first DirectX or C# application I have ever written so I am still learning..... I will be trying to fix whatever is broken and to add features. Simple zoom (mouse wheel, maybe) should be relatively simple, for example. I should have an updated version in a week or two. Let me know about any issues you find.
Well, as it seems there is no stand-alone model viewer, I just wrote one myself.
Here are a few sample images - just picked some random models from KotOR and KotOR2.
The viewer is not 100% ready - there is a handful of models that do not look right, and there are some things I would like to add, but I need information from BioWare for that.
I really wish I had a PC Now Also I couldn't help but notice the two droids in the first row, are they by any chance the concept droids for the Peragus Mining Facility or M4-78?
It seems that a few of the people who requested the beta did not receive it - in some cases because they were blocked from receiving zipped executable files.
Anyhow, I got some useful feedback, and am working on a version with three updated features.
1) The mouse scroll button now allows you to zoom.
2) The "black" model issue was, as suspected, caused by inverted normals (where the normal points "in" instead of "out". It seems the game does not care about those, but my DirectX code does. This problem has now been solved.
3) I am adding a "Save As..." feature to allow saving of retextured models.
I am also improving the documentation, so I should have the full (non-beta) version ready soon. but I am leaving on a small business trip tomorrow, so I will not be able to finish this until after I return next week.
I have a question: Is one able to show the animations of the models in the viewer also? In other words the animation for speech, for walking, and such?
Edit: Also! Is one able to add weapons to the models? Lightsabers and such?
Last edited by RedHawke; 05-05-2009 at 01:33 AM.
Reason: Combining double post...
I was wondering if anyone has ever written a model viewer for KotOR, or if not, whether information on the model file format is available, so I could more easily write it myself.
I'd rather not spend my time reverse-engineering the format if someone else has done it already.
_________________
Hi Adinos,
as it seems that you got the information you were looking for would you be willing to share your knowledge about the mdl file format with us?
greets,
shak-otay
edit: what I found is this but the pages are not easy to survey. Is this is the Kotor binary MDL format?
(The MDL/MDX seeem not to be the same as this!)
The issues found during the beta test should have been fixed (thanks for the help and suggestions, guys) and I added the "zoom" feature, using the mouse wheel, as suggested.
I noticed on the site you stated that you could switch skins. Can you also save these changes? It would be a lot easier than replacing the parts of the .TGA one by one. This is a definite download for me.
I, for one, approve of the Ewoks. They're a fine representation of the primitive natives doing better in their own environment than the invading white man.
Take that, Avatar.
"Welcome to The American Political System, where everything's made up and the votes don't matter!"
America: Where you have the freedom to express your opinions, and I have the freedom to hate you for it.
*dons stetson and putters away on the motor scooter of patriotism*
Interesting. Just tried it out with some weapon models of mine that have been compiled as game meshes. The blasters displayed fine, but I got an error when trying a lightsaber. It asked for the blade texture, so I browsed to a different directory than the mesh for it and got the following:
Show spoiler
Code:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.BitConverter.ToInt32(Byte[] value, Int32 startIndex)
at Model_Viewer.Model3D.readXYZ(Byte[] Data, Int32 pos, String s, Single& x, Single& y, Single& z)
at Model_Viewer.ModelKotOR.KOprocess_node_and_child_nodes(UInt32 nodestart, Byte[] Data, Byte[] MDX, Boolean process, String modeldir, UInt16 parent, Boolean KotOR2)
at Model_Viewer.ModelKotOR.KOprocess_node_and_child_nodes(UInt32 nodestart, Byte[] Data, Byte[] MDX, Boolean process, String modeldir, UInt16 parent, Boolean KotOR2)
at Model_Viewer.ModelKotOR.KOprocess_node_and_child_nodes(UInt32 nodestart, Byte[] Data, Byte[] MDX, Boolean process, String modeldir, UInt16 parent, Boolean KotOR2)
at Model_Viewer.ModelKotOR.KOprocess_node_and_child_nodes(UInt32 nodestart, Byte[] Data, Byte[] MDX, Boolean process, String modeldir, UInt16 parent, Boolean KotOR2)
at Model_Viewer.ModelKotOR..ctor(Byte[] Data, Byte[] MDX, String modeldir, String tex1, String tex2, Boolean KotOR2, String filter)
at Model_Viewer.frmMain.openToolStripMenuItem_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Model Viewer
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///E:/Star%20Wars%20Knights%20of%20the%20Old%20Republic/-=TOOLS=-/Model%20Viewer/Model%20Viewer.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Microsoft.DirectX.Direct3D
Assembly Version: 1.0.2902.0
Win32 Version: 9.05.132.0000
CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX.Direct3D/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.Direct3D.dll
----------------------------------------
Microsoft.DirectX
Assembly Version: 1.0.2902.0
Win32 Version: 5.04.00.2904
CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.dll
----------------------------------------
Microsoft.DirectX.Direct3DX
Assembly Version: 1.0.2911.0
Win32 Version: 9.12.589.0000
CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX.Direct3DX/1.0.2911.0__31bf3856ad364e35/Microsoft.DirectX.Direct3DX.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
I gather that the error is related to the mesh itself rather than the act of loading an external texture. It wouldn't surprise me, as MDLOps seems to do some screwy things to sabers.
As far as suggestions go, manual control of rotation/manipulation would be the most logical thing to request in a model viewer.
Module 1 Irenicus Dungeon has been released! Download it here
Module 2 is in development. More info is available via our forum
Follow us on Twitter
Module 2's opening cutscene released - Watch it now!
Last edited by DarthParametric; 05-19-2009 at 02:11 PM.
Two questions do I have: when dumping the C_Goblin_CL_BODY01.MDB
the ASCII dump ends like this:
Code:
1209: 974 975 969
Unable to handle block..
Can this be ignored when using your ASCII dump for ex-/importing?
2nd q.: Is there any 3D program that can import this ASCII format directly?
It seems to be very similar to the Wavefront obj format; exp.:
Show spoiler
# Max2Obj Version 4.0 Mar 10th, 2001
#
# object wozek01 to come ...
#
v 32.118301 15.749300 28.802399
v 27.051800 8.244300 28.774601
...
v -28.960499 30.216301 37.189499
# 1929 vertices