Aller au contenu

Photo

[TUTORIAL] How to add custom model to Toolset and the Game


  • Veuillez vous connecter pour répondre
166 réponses à ce sujet

#1
th3_selectah

th3_selectah
  • Members
  • 43 messages
Since I didn`t see a tutorial on how to add self made or customized models to the Toolset and the game i write one.Hope it helps :)

Preperation:
Download the following package: tazpn's Command Line Tools 

I also recommend you to to download tapzns build_helpers wich will do most of the work i state in the following sections.

Installation Notes: Extract both of the zip files in the same directory. Then edit daobuild.bat like that:
Between "CALL FBXCMD convert "%InputFileName%" "%FileName%.mmh.xml"" and 
"CALL GPMMH "%FileName%.mmh.xml"" add a "pause". 
That way we can edit the *.mmh.xml and change the reference to the mao file, before its converting it.

It should look like this:
...
CALL FBXCMD convert "%InputFileName%" "%FileName%.mmh.xml"
pause
CALL GPMMH "%FileName%.mmh.xml"
...

Step0:
When your model is rdy and textured, export it to a *.fbx file (i use w_lsw_ka01a_0.fbx as example from now on, it should have that style of name cause you have to add it later in the 2da tables).The model should be upside down!! As it is automatically rotated later on.Copy the file to tapzn`s tools directory.


Step 1(WITHOUT the helpers):
Go to command line, tapzn`s tools directory and use :
"fbxcmd convert w_lsw_ka01a_0.fbx w_lsw_ka01a_0.mmh.xml"

It should create 3 files: 

-w_lsw_ka01a_0.mmh.xml
-w_lsw_ka01a_0.msh.xml
-*.mao file named after the texture you used

Step 1(WITH the helpers):
Drag and drop your *.fbx on daobuild.bat and wait till it says "Press a button..." (do NOT press a button here!!!)

It should create 3 files: 

-w_lsw_ka01a_0.mmh.xml
-w_lsw_ka01a_0.msh.xml
-*.mao file named after the texture you used

Step2 (Both with and without the helpers):

Most probably you have to rename the *.mao file, which is in "None__teturename.dds.mao" format, as the toolkit wont accept that kind of filename. Just rename it to "texturename.mao".

Then you have to edit your mmh.xml file and change the reference which is found behind MaterialObject!!!


Step 3 (Without the helpers):


Take the *.mmh.xml file and drag and drop it on your 
"\\Dragon Age\\tools\\ResourceBuild\\Processors\\MMH\\GraphicsProcessorMMH.exe"
You get 2 files out of this: a *.mmh and a *.phy

Copy the *.msh.xml file to "\\Dragon Age\\tools\\ResourceBuild\\Processors\\MSH\\"

Then go cmd again, to the directory and use 
"processorsMSH -platform pc mmdtogff w_lsw_ka01a_0.msh.xml"
You get 1 file out of this: a *.msh

Step 3 (With the helpers):
Go back to your daobuild.bat window and press a random button. Then watch the magic.
Note: It opens a preview window of the Model + Texture, but the texture can be awfully wrong in some cases. Dont panic, try it in Toolkit before redoing.

Step 4 (with and without helpers):

Copy the *.mao, *.mmh, *.msh, *.phy, *.dds to  "\\\\\\\\Dragon Age\\\\\\\\pagages\\\\\\\\core\\\\\\\\override"

Go to your toolkit: File -> New -> Material

Right click -> Insert -> Insert Model -> choose your model

It should be displayed correctly here if you`ve done right up till now.


Step 5 (both with and without helpers):
Go to your Toolset and open 2da.erf 

Extract the fitting *.gda from the 2da.erf (longsword_variation.gda in my example)
Rename it to another name (longsword_variation_2.gda in my example)
Drag and drop the *.gda to your toolset console
delete all the rows  in the*.gda but 0 and 1 and change the variables of row 1:
Change the coloms of the Row 1:

-First is an int (number of the varition, keep in mind that you have variations in the longsword_variation.gda too!!)
-Second is the name that will be displayed in the Toolset (Katana in my example)
- 3-5 are the name of the file (that is why i chose such a name :P )
-6 is empty (at least in my example, dont know at other models)
-7 is "2"  (at least in my example again)

Save it.

Step 6 (both with and without helpers):

Copy the file you got now (*.gda) to your
"\\Dragon Age\\pagages\\core\\override\\"

Optionally you can pack them all into an *.erf file, which you can name after your liking ;)

Step 7 (both with and without again):
Start your toolkit again. If you did nothing wrong, you should be able to use the models now.In my example i made a new item (Katana) base type:Longsword and i can change the model to my Katana model. 

Step 8: Use following Tutorial to make new items and give it to your player

Step 9: See my follow up Tutorial on how to add NormalMap, SpecularMask etc to your custom Model

Hope i could help some of you by writing this :P

BIG THX to tapzn for writing the programs that help us make the game even more exiting

Did i say that i hate that this is ****ing up my posts every time i edit??!?!

Modifié par th3_selectah, 03 décembre 2009 - 12:24 .

  • ladyofpayne aime ceci

#2
Ambaryerno

Ambaryerno
  • Members
  • 532 messages
Excellent, I was going to need to know how to do this.

#3
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
Just an FYI, I believe you can just drop your created files (the compiled ones) into the override folder and have them show up. No need to insert them into the erfs. The 2da editing is probably still required, however, I haven't tested it, but you might be able to use m2da's instead, as thats kind of what they are for.

#4
Mungkee

Mungkee
  • Members
  • 7 messages
jep,it (nearly)works that way:
1.Put the neded files(mao,mmh...) into the packages\\\\\\\\core\\\\\\\\override folder
2.Take the gda from the 2da.erf and deleted everything in rows,so that there´s only your stuff left
3.Rename the gda,in my case i had to rename from armor_massive_variations.gda to armor_massive_variations2.gda,
  else the original menu is gone
4.To keep it all together,you can put everything inside an .erf file

Modifié par Mungkee, 28 novembre 2009 - 02:01 .


#5
th3_selectah

th3_selectah
  • Members
  • 43 messages
ah ok, didnt try that :P

#6
A1x2e3l

A1x2e3l
  • Members
  • 105 messages
What 3D modeler have you used?

What version of Autodesk FBX plugin should be used?

Does this work with skinned models?

Is it possible to rename the files at the last step?

Is it obligatory to pack all in erf?

I tried that with simple Max import/export (skinned model):
nothing works.

In override folder I have new: textures (dds), mao, msh, mmh,
phy.

Many thanks.
:)

Modifié par A1x2e3l, 28 novembre 2009 - 03:44 .


#7
th3_selectah

th3_selectah
  • Members
  • 43 messages
updated it a bit :)

#8
th3_selectah

th3_selectah
  • Members
  • 43 messages

A1x2e3l wrote...

What 3D modeler have you used?

What version of Autodesk FBX plugin should be used?

Does this work with skinned models?

Is it possible to rename the files at the last step?

Is it obligatory to pack all in erf? 

I tried that with simple Max import/export (skinned model):
nothing works.

In override folder I have new: textures (dds), mao, msh, mmh,
phy.

Many thanks.
:)



1. Blender 2.49

2. Normal Blender 2.4.9 Fbx Importer / Exporter

3. Don`t know excactly as i haven`t tested it, but i think its not working up till now. But tapzn is workin in this i think.

4. It is only possible to rename the *.mmh since it contains references on all the other files.

5. No, altered the Tutorial referencing that matter.

6. A good thing to do if you don`t know why it doesn`t work is:

- Make sure you dont rename any files, except for the *.mao since it has bad naming. DO NOT forget to change the references in your *.xml files !!!!!
- Drag and Drop your *.fbx file on tapzns Viewscene ->if it does not show any your export / model are wrong
- Drag and Drap your *.mmh file on tapzns Viewscene (All other files have to be in the directory) -> if it does not show anything, but shows your *.fbx file you either forgot to move all the files to the directory, or it cant read your *.dds file, since that one has to have 2x2 dimensions (32x32, 64x64, 128x128, and so on)
- If its showing your *.mmh file, copy all the files to the override directory, start toolkit, New -> Material -> Right Click ->Insert ->Instert Model -> chose your model. It should be displayed here.

#9
Adinos

Adinos
  • Members
  • 341 messages
It should be noted that steps 4-6 apply as well if you are making new models by retexturing or rescaling existing models with DATool.

#10
tazpn

tazpn
  • Members
  • 70 messages
Thanks for doing this. Been meaning to write up my workflow in simpler terms that people could understand but never get around to it.
I highly recommend people create a simple BAT script for whatever project they are working on that does all of the build steps for them. Usually takes some extra time to setup but if you do something repeatedly then it save frustration. It usually requires configuring paths and whatnot which makes it difficult to share easily though. In theory we could setup resourcebuilder to do it but I've had no luck.
I create a source folder for my project where everything goes. All XLS and DDS files are put in that folder. I then export the FBX files to that directory and then run the script. It will recreate all of the custom files for that item and put them in the correct location so I dont have to remember everything.
I dont recommend copying files to the tools directory for anything. Do it all in place in a temporary directory on a per project basis so you dont mix and match files. Perhaps I'll do a quick sample as a blog of how I do it though it needs to be greatly expanded.
I dont put the .MSH.XML or .MMH.XML in the override or anything non-essential. You dont need the ERF to test though perhaps its required once you start creating the dazips for release. The MMH.XML and MSH.XML files in theory can be used standalone in the override directory but I prefer to use the compiled versions there.

Modifié par tazpn, 28 novembre 2009 - 04:44 .


#11
th3_selectah

th3_selectah
  • Members
  • 43 messages
I tend to write a Java-Programm that will do all that work.

Ill upload it, once its done, but dont expect it before tomorrow.

Modifié par th3_selectah, 28 novembre 2009 - 06:29 .


#12
tazpn

tazpn
  • Members
  • 70 messages
The problem with java or python or whatever is now I have to have java to compile it and perhaps change it. I've got some simple scripts that I'll release those as part of a blog on it (my editor just crashed and erased quite a bit of it.).

for example I use a bat file like the following for some of my builds:
EDIT: Example removed.  See my blog entry Bending the Command Prompt to your Will


In this one I do some conversion then some compiling. I then throw in an XLS export. The problem with most UI tools is that they are not flexible enough and it takes quite a bit of effort to make them that flexible. Something that runs a partial script might be ok.

I need placeables sheet exported and then maybe I also need later add an export of APR_base in addition to placeables. I think bioware tried to make the m2da thing do this but I've not fully understood how to properly use it.

Modifié par tazpn, 29 novembre 2009 - 01:44 .


#13
A1x2e3l

A1x2e3l
  • Members
  • 105 messages
Thanks a lot guys!

I was obviously doing wrong naming. I have to try form the
scratch with a fresh head.

I wish I could understand all what you are talking about. Is
NPC(body, armor, etc.) a “placeable”? And these cryptic symbols “
%~n1
”……
What
s
that? FBX file name e.g.
MyModel.Fbx
,
SET
FileName= MyModel.Fbx
or
run this BAT with MyModel.Fbx  like
other command exes?

Th3_selectah,
such an important tutorial should be posted on a better place, here on the
Forum it could be soon lost. Please, update it.

:)

#14
th3_selectah

th3_selectah
  • Members
  • 43 messages
ok, where should i post it?

#15
A1x2e3l

A1x2e3l
  • Members
  • 105 messages
I have no clue, I am lost with the Forum navigation system. The options
could be nexus, or DA:O ToolSet wiki, or as a Project here.

:)

#16
tazpn

tazpn
  • Members
  • 70 messages
th3_selectah, I would at least create a blog post replicating the information under your account so that it can always be referenced easily. Not sure we are wiki ready with the workflow but its a starting point.



Axel, sorry about that code. Its what I was using though I've since rewrote all of that to make it more newb friendly and for probably easier for me to work with as well.

I've created a blog entry describing its use here: Bending the Command Prompt to your Will



Basically I've create a bunch of scripts that when put together with my fbxcmd tool and setting a global setting makes it much easier to setup a custom build. I will then put together another blog entry which will go through the steps for making it a placeable which I will then convert it to a weapon.

#17
A1x2e3l

A1x2e3l
  • Members
  • 105 messages
Tazpn, thanks a lot! Please, do not waste you time on that,
there are skilled people here that are able to “translate” what you are saying
for the unprepared users like me.

Th3_selectah, have you seen Blender 2.5 alpha? I am too
stupid for Blender UI, and they are saying that program UI was significantly
redone.

:)

#18
th3_selectah

th3_selectah
  • Members
  • 43 messages
 Ok, ive created a blog entry: [Tutorial] How to add custom models to the Toolset

@Axel: The 2.5 version is quite nice imo. They made it much more userfriendly and "easier to look" on. But sadly they havent included most of the export / import options up till now, and that makes it not useable for me atm.

Modifié par th3_selectah, 29 novembre 2009 - 10:32 .


#19
A1x2e3l

A1x2e3l
  • Members
  • 105 messages
Could you post a link to your blog. I checked Tazpn’s blog
instructions: that’s much too mush for me (sorry Tazpn). I prefer your “digests”
that explain the “manual” use of his command tools.

Well, Blender 2.5 is an alpha and developers are pretty
active.I am a Max user but have no direct access to it. I am
thinking now what software to learn: XSI mod tool or Blender. I am scared that
XSI mod tool will be soon forgotten by developers as it was the case with Maya
PLE and gMax. I tried Blender in the past but as many others was totally
confused with unusual UI and zillions of obligatory hot-keys. Hence, I am
collecting opinions of Blender pro users about new Blender interface.

Thank you.
:)

Modifié par A1x2e3l, 29 novembre 2009 - 06:39 .


#20
tazpn

tazpn
  • Members
  • 70 messages
Ok thats fair. I think its a poor use of my time as well but not sure if someone else will do it if I don't. Or I just have to break down and do a UI like th3_selectah is planning but I'll stick to make it work first plan.



Tried the new blender and its pretty non-functional (as would be expected for an alpha) Couldn't import any models and menus worked strangely much of the time like not showing child options and many errors in the console window. Anyway its an improvement though the mouse interaction model still bothers me. I'll wait for the beta to try again.

#21
th3_selectah

th3_selectah
  • Members
  • 43 messages
 Ok, first heres a link to my blog.

I think its not neccessary to write a graphical programm doing the conversion routine, as your batch already does it more then good enough by simple drag and dropping the *.fbx file onto daobuild.bat.

Tapzn i got a question regarding the fbxcmd: When i want to convert a simple Tsuba, which is basically an altered cylinder with 2 "holes" in it, i get "Cylinder is not a triangle mesh. Triangulating...", wich is not that bad but it doesnt do anything, except for counting up memory used every sec or so. Is that normal? Do i have to wait longer then 20 min to get it, or is there some kind of continues loop, or memory leak?

#22
A1x2e3l

A1x2e3l
  • Members
  • 105 messages
Actually I am fine with readme “manual” instructions
supplied with your command tool. Scripting automatisation can be very handy for
some skilled people, but for now I would prefer to have command exes as
functional as possible, we can manage (with some clarifications e.g. the
discussed tutorial, this post) to use them manually.

IMHO we have no luxury to “misuse” programming manpower of
the community (does anybody else is working on Max/Blender, etc.
importers/exporters? or able, eager to do that?). It is reasonable (for all of us)
to concentrate on issues that nobody else can do for whatever reasons: not
sufficient knowledge, no access to software, time problems, etc. So far that
worked: Tazpn has created command tools with short instructions that skilled
modders are able to understand; Th3_selectah tested and digested that and wrote
this tutorial in plain English; now more people are able to work….

:)

#23
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
I'm working on a 3dsmax script which will export. I am not planning on doing imports, and I don't think it would be possible to import an mmh using maxscript.

#24
th3_selectah

th3_selectah
  • Members
  • 43 messages
Ok, it ran for 40 min now...



Tapzn could you see into that problem? I confimed that it is cause of the 2 holes in the cylinder, as if iam doing it without the holes its finished in 1 sec

#25
tazpn

tazpn
  • Members
  • 70 messages
No thats a bug. The triangulation is a FBX toolkit function so I dont know what its doing specifically. You might consider exporting it as tri-mesh before putting it in the FBX though I would hope both ways would work.

For just about any mesh it shouldn't run for more than about a minute (and thats for 10000+ vertex meshes). I'd kill it (type Ctrl-C or Ctrl-Break). I'll try to simulate though your specific example would be better. I've made a bunch of fixes that I'm still testing with.

EDIT: I've tried testing with teapots, cylinders, tubes, torus, sphere, cones as quads and polygons and straight FBX. Can you provide a link to the source object?

Modifié par tazpn, 29 novembre 2009 - 09:59 .