Tutorial : How to add a new model?
Go to page 1, 2, 3, 4  Next
 
   Forum Index -> Mods & Maps
View previous topic :: View next topic  
Author Message
Yomgui
NE Veteran
NE Veteran


Joined: 18 Jan 2010
Posts: 186
Location: Troyes

PostPosted: Fri Feb 18, 2011 2:33 pm    Post subject: Tutorial : How to add a new model?

How to add a new attachment to Age of Empires III

- Tutorial by Yomgui -

Yes, you read correctly, today we are going to learn how to add a granny file to Age of Empires III.

Here is screen of what you will get eventually :



Yes, I know, a cylinder hat has strictly nothing to do in AoE but this is merely an example. (This one is not perfectly adjusted, it can be corrected though, do not worry).

I. What do we need?

Compulsory tools :
- Age of Empires III (of course) (the version does not matter)
- 3DS Max 7
- Expotron plugin
- Nwn2 plugin
- AoE3Ed (http://forums.heavengames.com/redir/http%3A//games.build-a.com/aoe3/files/AoE3Ed.exe)

You might also need :
- Granny viewer (always useful)
- BRF edit (quick way to modify .obj files)

You can find everything you need at this address :
http://www.ne.elpea.net/downloads/AoEIII_3dset.rar

It contains everything except, obviously, AoE and 3DS max.

I will show, in this tutorial, how to modify a 3d model and how to convert it into a .gr2 file accepted by the game engine. I will therefore take .obj files as a basis of my work (it should work for any other kind of 3d files, but I haven't tested it yet, so you'd better stick to .obj files)
Note also that I am speaking here of importing attachments, not whole units or buildings (even if the latter is possible and the first one way more complicated for the moment since it will not have animations).

You'll also need some basic skills in 3d editing, and with 3DS Max. I am not a 3d artist at all and learn how to do it alone for the purpose of aoe3 modding. Consider therefore that it is not difficult to do.

II. Choosing and preparing the model

For the sake of this tutorial, I will use a cylinder hat model in a .obj format. You can find a lot of good .obj models in some mods for Mount&Blade. However, ask their creators before using the models, even if modders from this game release their material open source.

1) Rotating the model.


First of all, we need to rotate the model in order for it to be correctly positionned in Aoe3 (Indeed, aoe3 uses peculiar orientation properties).
Arrow Open BRFedit
Arrow Click Import, then Static Mesh and choose your .obj file.



You should obtain that :



Arrow Click right on your mesh and select roto-translate-rescale :



Arrow For a hat, if you want to have the proper orientation ingame you should modify to obtain this :



However, this is for hat coming from M&B, maybe it'll be different from models from elsewhere. You'll have to test it ingame and adjust carefuly. It is just that BRF edit is a fast way to modify .obj. But you can use anything program you want. (If you do this directly in 3DS Max, it won't work for some odd reason).

Arrow This done, click right on you mesh's name and select export static mesh. Save your file.



When you'll close the application, you'll be able to save a .brf to keep the .obj in it, with proper orientation. This is up to you.

2) Preparing the texture.


Beware, this part is really important. I assume that you have a texture with your model (if not, create and apply one but that's advanced 3d skills and it is not up to me to teach you that)

Arrow Get your texture, it should be (if from M&B) in .dds format.
Arrow Anyway, convert it to .tga with gimp photoshop or even XnView
Arrow Resize it to 128x128 pixels (if you don't, the texture will be distorted in game and you don't want that.)

Arrow When this is done, open AoEIII art directory and create a folder. Call it 3d_models for instance.
Arrow In it, create a folder that you will call relevantly. Mine is called cylinder_hat (as a general rule, avoid spaces if you can and replace them by underscore).
Arrow In this folder, you'll have to place your texture. (Again I strongly advise you to call it relevantly, cylinder_hat.tga for example)
Arrow Create a copy of that .tga file that you will name your_file.(0,1,8,5).tga (your_file is a placeholder, don't play the moron)
Arrow Convert this your_file.(0,1,8,5).tga using AoE3Ed convert tool.
Arrow At that step, you should have three files in your folder : a .tga, an extended .tga and a .ddt. Delete the (0,1,8,5), it is not useful anymore.

III. Convert the model into a granny file

1) Importing the model into 3DS.


Arrow Open 3DS Max 7 (do not forget to install the required plugins before)
Arrow Import the .obj into 3DS (be sure to select file/import, then select file format .obj, Wavefront Object format)
Arrow Click OK twice and you should get that :



2) Applying the texture.


Arrow Click on this icon :



Arrow A window will appear, click on the Maps tab below :



Arrow Click on the None frame beside Diffuse Color
Arrow Another window will open, select Bitmap
Arrow You have to select your texture. Browse until you arrive into your folder your_file into the art directory of AoE. Select the tga file. BEWARE: Be sure to select the tga file without (0,1,8,5) in case you did not delete this one as I said earlier. I you do not do so, your model will not have any texture ingame.
Arrow This done, one of the balls should have taken the texture. Drag and drop this ball on your mesh. This one should change color (without having the texture though) If you want to be sure, click on the teapot on the right of the app :



3) Rescaling the model.


Aoe 3 uses a specific units of measure. However, and I tried, if ou give this one to exported gr2 models, it does not work. We therefore have to rescale manually the model so it has a good size in game (It means that you'll have to try two to six times to find the correct size ingame. I know, it is experimental).

Arrow On the perspective window, click right on your mesh and select scale :



Arrow Make your mesh way bigger (usually, for a .obj imported hat, it is between two and three squares large. Refer to the screenshot)



4) Exporting the model.


The next step is to make a proper gr2 file.
Arrow Save your 3DS Max project for further editions (and believe me, you'll need them)
Arrow Click file, export and, as on the screen, select gr2 :



Arrow Give a relevant name, choose desktop to save on and then click save.
Arrow A new window will open :



Arrow Click on animation, then untick "Include reference in export"
Arrow This done, click export.
Arrow You should have a granny file on your desktop now (or wherever you saved it) Double click on it to see if it went well.

IV. Making the Attachment appear ingame

Arrow For testing purposes, I advise you to create a new proto unit. Give it a new anim file.
Arrow Place your newly created gr2 file into your_file folder, beside your texture.
Arrow In the animfile of your unit, replace the model address of your attachment by yours.
Arrow Below, when you attach on the unit's model, the bones does not matter. the from_bone, can be anything, it won't change anything. the to_bone can be the same as used before. Otherwise, use global bone names like HEAD, or SPINE.
Arrow Launch aoe3, launch editor, spawn your unit, it should have a brand new attachment. Then, if it is too large, too small, not well orientated, repeat earlier phases until the model matches what you want for it.

Well, that's mostly it. Hats work perfectly, cloaks too. Haven't tested weapons yet but it should work alike.
For any questions, any problems, please send a private message to me (Yomgui) either on aoe3 heaven forums or ne.elpea one.

I would love to show some of the attachment realized, but they have to remain secret. Try and imagine...

Good luck
Back to top
View user's profile Send private message
The Dude
NE Assistant
NE Assistant


Joined: 13 Mar 2010
Posts: 1709
Location: Somewhere you don't know

PostPosted: Fri Feb 18, 2011 4:00 pm    Post subject:

Awesome! Thanks, K&B might need a few models...
_________________
Alea iacta est.
-The die is cast-

-Julius Caesar

Back to top
View user's profile Send private message Visit poster's website
Hoop Thrower
Councillor
Councillor


Joined: 16 Mar 2010
Posts: 744
Location: Chile

PostPosted: Fri Feb 18, 2011 8:24 pm    Post subject:

Let's see how the people at heavengames react to this (no new stuff, ha!)
_________________

Quote:
Work hard? No, it is a game rather than a work; interesting rather than hard.


Visit Wotta!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
peugeot407
Councillor
Councillor


Joined: 24 Jun 2008
Posts: 1734
Location: Netherlands

PostPosted: Fri Feb 18, 2011 10:00 pm    Post subject:

Question 1: Are you going to post this again at HeavenGames, or should I just add a link in the Tutorial Database pointing to this thread?

Question 2: Have you tried exporting a model from AoE3, altering it (for example removing cannons from the Fortified Outpost model), then re-importing it in the game?

Question 3: Why did those silly hats on Skirmishers make me laugh continuously for five minutes?

Question 4: Are you aware you're a modding hero?


peugeot407
_________________
SAOL wrote: "North America, South America, pish posh they're the same.
Spawn of greater nations."





Back to top
View user's profile Send private message MSN Messenger
Yomgui
NE Veteran
NE Veteran


Joined: 18 Jan 2010
Posts: 186
Location: Troyes

PostPosted: Fri Feb 18, 2011 11:40 pm    Post subject:

@peugeot407 :

1. The tutorial is already posted on aoe3 heaven forum already. I posted the tuto on both sites at the same time.

2. I tried, but for the moment, this is not giving anything good. You'll have news about it when it succeed in making something interesting. But I think I can remove your cannons, just let me check that tomorrow.

3. Because those hats look ridiculous on skirmishers maybe?

4. Why does that make me laugh continuously for five minutes?
Back to top
View user's profile Send private message
peugeot407
Councillor
Councillor


Joined: 24 Jun 2008
Posts: 1734
Location: Netherlands

PostPosted: Sat Feb 19, 2011 12:43 am    Post subject:

Saw it now. I was being a bit stupid for asking whether you posted it when I hadn't even looked at HG for days. Razz

Oh, and it's in the Tutorial Database as well. If you do actively check both forums, there is now a 100% chance you double-read this.


peugeot407
_________________
SAOL wrote: "North America, South America, pish posh they're the same.
Spawn of greater nations."





Back to top
View user's profile Send private message MSN Messenger
arcalion
Councillor
Councillor


Joined: 10 Apr 2010
Posts: 3147
Location: colombia

PostPosted: Thu Jun 09, 2011 3:51 pm    Post subject:

i know that it would be embarrasing, but, i already do a new model, the main problem is that it doesnt show the texture in game, it just look like a black colour, so yomgui, what do you think that would be the problem?
_________________
The first modder in imported models in AOEIII.
TFN leader!!
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Yomgui
NE Veteran
NE Veteran


Joined: 18 Jan 2010
Posts: 186
Location: Troyes

PostPosted: Thu Jun 09, 2011 3:59 pm    Post subject:

You will have to be a little more specific I fear. With so few information, I cannot really help you.
Back to top
View user's profile Send private message
arcalion
Councillor
Councillor


Joined: 10 Apr 2010
Posts: 3147
Location: colombia

PostPosted: Thu Jun 09, 2011 7:04 pm    Post subject:

ok, ok, i take some screenshoot for explain my litle problem:

this is my new model in 3D MAX8, it have the texture that i want:
Spoiler:



but ingame with all checked, replacetexture tags addeds and alpha layer:
Spoiler:



just a model with black texture Sad
(is a box of potatoes)
_________________
The first modder in imported models in AOEIII.
TFN leader!!
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
peugeot407
Councillor
Councillor


Joined: 24 Jun 2008
Posts: 1734
Location: Netherlands

PostPosted: Thu Jun 09, 2011 11:24 pm    Post subject:

Wow! A box of potatoes! Was that really the first thing you thought about would make a nice addition to AoE3??? Mr. Green Mr. Green


peugeot407
_________________
SAOL wrote: "North America, South America, pish posh they're the same.
Spawn of greater nations."





Back to top
View user's profile Send private message MSN Messenger
arcalion
Councillor
Councillor


Joined: 10 Apr 2010
Posts: 3147
Location: colombia

PostPosted: Fri Jun 10, 2011 1:57 am    Post subject:

peugeot, the main objetive of this is see if i can add a texture to a brand new model, if i can do it, tehn i would do some other models like as bycicle, animals, etc did you understand?
_________________
The first modder in imported models in AOEIII.
TFN leader!!
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Yomgui
NE Veteran
NE Veteran


Joined: 18 Jan 2010
Posts: 186
Location: Troyes

PostPosted: Fri Jun 10, 2011 8:22 am    Post subject:

@arcalion :
First of all, the replace texture tag is not to be used with new models.
Now, your texture must be targa, not wider than 124x124. When you apply your texture on the model in 3DS, you have to point toward a texture within the aoe3 art directory, otherwise it won't work. Moreover, you have to convert your targa to ddt and keep it in the same directory. If all of this is done correctly, your texture should show up ingame.
Back to top
View user's profile Send private message
arcalion
Councillor
Councillor


Joined: 10 Apr 2010
Posts: 3147
Location: colombia

PostPosted: Fri Jun 10, 2011 1:20 pm    Post subject:

interesting, most of you step are different of my original form.... anyway, i am going to try that Wink

UPDATED: i tried you step, but keep having the same problem, just show a model in black inside the game, so any suggestion?

PS: i was reading you tutorial, you didnt use the ddt file of the texture why?
_________________
The first modder in imported models in AOEIII.
TFN leader!!
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
arcalion
Councillor
Councillor


Joined: 10 Apr 2010
Posts: 3147
Location: colombia

PostPosted: Sun Jun 12, 2011 11:17 pm    Post subject:

sorry for the double post, but yomgui, i finally get my model work but....
we need made a new tutorial because i had to merge my form of import models with you form of imported model for get new models with nthey own textures.... i want show you my job, but i cant, is a secret Mr. Green
_________________
The first modder in imported models in AOEIII.
TFN leader!!
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Tilanus Commodor
NE Commander
NE Commander


Joined: 03 Apr 2007
Posts: 5080
Location: Berlin, Germany

PostPosted: Mon Jun 13, 2011 1:34 pm    Post subject:

Then make an easier example, something very basic. Wink
_________________
Napoleonic Era Project Leader


** Support me to support NE **

Test your Age of Empires knowledge in my
Grand Age of Empires quiz! King Green!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
arcalion
Councillor
Councillor


Joined: 10 Apr 2010
Posts: 3147
Location: colombia

PostPosted: Wed Jun 15, 2011 12:14 am    Post subject:

in this tutorial, he IMPORTED a model of another form, but not ever work, i have my own form and also I CAN MAKE new models.... a clear example was the potatoes box Razz
_________________
The first modder in imported models in AOEIII.
TFN leader!!
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> Mods & Maps All times are GMT
Go to page 1, 2, 3, 4  Next
Page 1 of 4

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Powered by phpBB © 2001, 2005 phpBB Group | Page design by Tilanus Commodor & michfrm.