You must be logged in to post messages.
Please login or register

Modding Discussions
Moderated by Alexastor, MosheLevi, Mister SCP

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Tutorial : How to add a new model?
posted 02-18-11 09:48 AM EDT (US)   
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 :

[PNG, (540.30 KB)]

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://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).
-> Open BRFedit
-> Click Import, then Static Mesh and choose your .obj file.



You should obtain that :



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



-> 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).

-> 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)

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

-> When this is done, open AoEIII art directory and create a folder. Call it 3d_models for instance.
-> 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).
-> In this folder, you'll have to place your texture. (Again I strongly advise you to call it relevantly, cylinder_hat.tga for example)
-> 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)
-> Convert this your_file.(0,1,8,5).tga using AoE3Ed convert tool.
-> 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.


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



2) Applying the texture.


-> Click on this icon :



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



-> Click on the None frame beside Diffuse Color
-> Another window will open, select Bitmap
-> 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.
-> 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).

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



-> 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.
-> Save your 3DS Max project for further editions (and believe me, you'll need them)
-> Click file, export and, as on the screen, select gr2 :



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



-> Click on animation, then untick "Include reference in export"
-> This done, click export.
-> 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

-> For testing purposes, I advise you to create a new proto unit. Give it a new anim file.
-> Place your newly created gr2 file into your_file folder, beside your texture.
-> In the animfile of your unit, replace the model address of your attachment by yours.
-> 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.
-> 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
Replies:
posted 02-18-11 01:48 PM EDT (US)     1 / 28  
This is a very nice post.
Also the first english written one to see for me.

Thanks yomgui
posted 02-18-11 02:08 PM EDT (US)     2 / 28  
Will newsie this, but before I do due to a few false starts can someone else verify this works, thanks.

Also here you mention modifying a model, doe this method allow for creation also?

And finally are all the programs needed (except AoE3) free?

Maffia

This month I have mostly been playing Zelda Breath of the Wild
Steam - Maffia GFWL - Maffia01 YouTube - HGMaffia Twitter - @HGMaffia
Age of Empires 3 Heaven Seraph

What is this life if, full of care, We have no time to stand and stare.
[This message hasn't been edited by fred_ernie (or Maffia) (not edited 12-29-2005 @ 09:57 AM).]

[This message has been edited by Maffia (edited 02-18-2011 @ 02:10 PM).]

posted 02-18-11 02:18 PM EDT (US)     3 / 28  
Thanks for your interest Maffia. Tilanus Commodor, Tahattus and Peugeot407 may testify that my operations do work for they have seen other models I imported and Tilanus at least, tested them ingame. One thing that one might want to check is if the models work when aoe3 is not installed at the default directory.

All the programs listed are free except from AoE obviously and 3DS Max 7. Problem is that the plugins necessary to operate have not been released on free products yet (Blender for instance).

It is possible indeed to create the model itself if you know how to do it. Moreover, even if the method I explain here speaks about .obj, every 3D formats read by 3DS Max 7 are good to be used. (There might be a problem only with animations and bones, that's all.) But currently, the .obj format remains the easiest go.

I forgot the possibility of adding a bump texture in the tutorial. I'll correct that as soon as possible.

[This message has been edited by Yomgui (edited 02-18-2011 @ 02:27 PM).]

posted 02-18-11 07:28 PM EDT (US)     4 / 28  
I have indeed seen screenshots of some rather peculiar hat attachments that certainly didn't ship with AoE3. Also, the whole operation seems highly plausible to me, even though I haven't actually tried it yet.

To anybody reading about 3DS Max here, I would just like to say 'Buy it, and if you don't have the money, don't bother. Downloading this program without a license is illegal' In fact, I don't care about how you got 3DS Max (or not, the latter being highly advicable), it's your funeral. Of course I know you're all going to illegally download it, just don't get the idea any member of the modding community would recommend any illegal activities, including petty ones like these.


peugeot407

PS: I think that sounded rather clever, actually. Or smart-arse. You choose.

|> Robert Faber (aka peugeot407)
|> Humble Creator of: Knights and Barbarians, Danish Civ Mod, Several Tutorials and the Tutorial Database
|> November 2007 Modding Contest: 2nd place (me: 360 pts, Captain_Soanso: 365 pts!)
|> January 2008 Modding Contest: first place!

When in doubt, flat out! (Colin McRae)

[This message has been edited by peugeot407 (edited 02-18-2011 @ 07:29 PM).]

posted 02-18-11 09:31 PM EDT (US)     5 / 28  
Will newsie this, but before I do due to a few false starts can someone else verify this works, thanks.
I don't doubt someone is getting this to work, but I'm not just yet. Of course, I haven't been able to edit an object file with BRF edit yet; it crashes every time I try to import so I've just been puttering around in 3DS Max.
He did say:
If you do this directly in 3DS Max, it won't work for some odd reason
Does this mean that importing it as an object is essential?
Downloading this program without a license is illegal
Agreed peugeot407. Don't forget, however, the power of free trials! Perfect if you just want a few things.
Speaking of 3DS Max free trials, mine expires in 9 days. Hope I get this working for myself soon!
posted 02-19-11 05:05 AM EDT (US)     6 / 28  
@IMeMine :

Some .obj cannot be read by brfedit indeed (especially those created when converting a .gr2, too bad no). But brf edit is not a compulsory step, I use this program because it is convenient with the models I already have. The thing is that you have to find a way in 3DS Max 7 to rotate the model according to its origin point (0,0,0) and not from the origin point of 3DS creation space. I must avow I did not succeed to find a way to do it in 3DS, but this is theorically doable.
posted 02-19-11 10:00 AM EDT (US)     7 / 28  
I don't understand what exactly Yomgui meant when he cited me, but adding models is possible as I (and arcalion) managed to do it - I just gave up of it when I realized I couldn't do animations for the models I got.

Lord Tahattus - Register yourselves at the WotTA forum!
WOTTA WEBSITE!
War of the Triple Alliance Beta!
Flags for new Civilizations, The Asian Dynasties, Knights and Barbarians and Napoleonic Era
TWC Tutorials: Basics of Modding - The List of Modding No-nos - Adding a Nation - Music and Sounds - Initilization Failed

WotTA back to active!
posted 02-19-11 11:22 AM EDT (US)     8 / 28  
Don't be defeatist, Tahattus... Only a few months ago we thought we'd never get new models in the game, and now we have. It might well be the same for animations.


peugeot407

|> Robert Faber (aka peugeot407)
|> Humble Creator of: Knights and Barbarians, Danish Civ Mod, Several Tutorials and the Tutorial Database
|> November 2007 Modding Contest: 2nd place (me: 360 pts, Captain_Soanso: 365 pts!)
|> January 2008 Modding Contest: first place!

When in doubt, flat out! (Colin McRae)
posted 02-19-11 04:21 PM EDT (US)     9 / 28  
Only a few months ago we thought we'd never get new models in the game
It was already years ago, someone reported about successfully adding gr2 models from another game. However no textures, no animations could be carried over.
Though there was used the same granny engine as in AoE3, the gr2 structure itself was totally different. And that's what ES did: using a customized granny engine, adapted environment for own purposes.
And just there is the difficulty. One has to own the essential tools ES used:
- at least the RADgametools Granny 3D SDK (12,500 US$)
- Autodesk 3DSmax (3,500 US$) or another program which outputs files usable by the granny system
Nice prices to tinker around with a 30$ game.
Besides one has to know about the customization ES did. One has to be an experienced programmer - the granny SDK (source development kit) is beneath runtime-libraries mainly source code to embed in the own game engine.

and just a warning for people who download the above programs illegally:
The people offering cracked versions don't do it for charity. If it works at all, you'll get a whole bunch of intruders additionally: worms, viruses, etc.
posted 02-20-11 09:24 AM EDT (US)     10 / 28  
I can assure you: this method works.

Here some corrections for the AoE3 Modding history log writers:
1. The_Assimilator was the first of us who imported a granny file WITHOUT texture successfully into the game
2. arcalion and Tahattus were the first of us who got granny files from another game WITH textures into the game (scalable?)
3. HGJF was the first of us who got a 3d model - created by HIMSELF - successfully into the game, scalable and WITH texture (no bumpmap)
4. Yomgui was the first of us who got a 3d model (.obj format) - created by others - successfully into the game, scalable and with texture (afaic: sometimes with bumpmap?)


I'm sorry peugeot, but what you said about the possibility to get models into the game is just wrong.

@Tahattus - He cited you, cause I showed you a screenie of his work. (and afterwards I told him)

The Ancient Age | Napoleonic Era

Modding is art!
posted 02-20-11 10:21 AM EDT (US)     11 / 28  
Correct me if I'm wrong .. but afaik Alexastor (aka Kastor, Xastor,..) was the first one who imported successfully a gr2 model from Stronghold? into AoE3. I don't remember the thread (unluckily didn't find about search), but was in early AoE3 discussion, assuming ~ 2006/7?
posted 02-20-11 08:11 PM EDT (US)     12 / 28  
Could be, I haven't heard of that even though I'm a friend of him, but maybe I also just missed it.

Whatever!

Here some proofs!


[PNG, (862.00 KB)]
[PNG, (0.98 MB)]

You can also add bumpmaps. Rescaling is possible, model modifications too. I'll continuously work with Yomgui on the tutorial to improve it. Similar objects mostly require the same orientation, i.e. a hat requires other values for the X, Y and Z axis than a rifle does. I'll work out the configs for the most relevant stuff, weapons, hats, etc.

[PNG, (174.01 KB)]
No, not a rocket launcher, just the wrong config.

[PNG, (448.70 KB)]
Peng! PENG! This rifle actually has a wrong texture. The alpha layer has to be blank, otherwise you cut into the model or .. just mess up the texture. ^^

As you can see the models are far more detailed than the textures. In that case you can just use models with less polygons or decrease the number of them if you know how to do it (I don't).

The Ancient Age | Napoleonic Era

Modding is art!

[This message has been edited by Tilanus Commodor (edited 02-20-2011 @ 08:33 PM).]

posted 03-21-11 11:50 AM EDT (US)     13 / 28  
Is it possible to create units and animate them?
posted 03-21-11 12:36 PM EDT (US)     14 / 28  
It may be at some point in the future, but nobody has figured it out yet, so for now the answer has to be 'no'.


peugeot407

|> Robert Faber (aka peugeot407)
|> Humble Creator of: Knights and Barbarians, Danish Civ Mod, Several Tutorials and the Tutorial Database
|> November 2007 Modding Contest: 2nd place (me: 360 pts, Captain_Soanso: 365 pts!)
|> January 2008 Modding Contest: first place!

When in doubt, flat out! (Colin McRae)
posted 03-21-11 10:44 PM EDT (US)     15 / 28  
Ok, and is it possible to mess around with existing models? For example, Chakram's "bone_sword" attachment is just below the hand and not in it. So when I give him a Talwar it looks like its stuck to his fist. Can I edit that attachment point to be a little higher?
Also if I were to make his turban different would I be able to do that? (its all one model)
posted 03-22-11 07:23 PM EDT (US)     16 / 28  
I haven't tried it yet, but in view of the modding tools I think it's not possible to edit it since we're using a granny exporter and an importer

You better look for a way to turn it into an obj file and adjust it. That would be easier.

The Ancient Age | Napoleonic Era

Modding is art!
posted 03-23-11 10:06 PM EDT (US)     17 / 28  
WOW, I can't even *view* the Chakram model in Granny viewer, let alone modify it.
posted 03-29-11 00:27 AM EDT (US)     18 / 28  
Hey
1. is 3ds max 7 compatible for Windows Vista?

2. If your attachment is a sword, does it swing properly when you assign coordinates like that?

[This message has been edited by Jang_Bahadur (edited 03-29-2011 @ 00:28 AM).]

posted 04-02-11 02:58 PM EDT (US)     19 / 28  
Yes, a sword swings the correct way. As I still only work with Mount & Blade models, I can't tell you anything about the normal way to configure the model position. However, I have some values that work on all M&B models.

3ds Max 7 should be compatible with Vista, but no guarantee on this, since Vista is a b!tch.

The Ancient Age | Napoleonic Era

Modding is art!
posted 04-11-11 11:26 PM EDT (US)     20 / 28  
I can't get textures to work. If I don't put textures in 3ds max 7 then they turn out white but I did and it shows up in 3ds max. But in AOE they appear black.

Help me out guys!

[This message has been edited by Jang_Bahadur (edited 04-11-2011 @ 11:58 PM).]

posted 04-14-11 12:53 PM EDT (US)     21 / 28  
How do you try to add the textures?

Remember these should be targa files since the game only reads these (or the converted ddt-files). The Material Editor is the place to go, does the texture show up in 3ds Max if you render it?

The Ancient Age | Napoleonic Era

Modding is art!
posted 04-15-11 01:25 PM EDT (US)     22 / 28  
Ok here's what I do.
I make the model in Max 9 on Vista. Then export it as an OBJ. I bring it into BRF to orient it. Then take it to Virtual Xp, where I bring it into Max 7.
In max 7, I open materials editor beside diffuse there is a square, I click on that. Double click on bitmap, click on my targa file (without the 0,1,8,5). The texture shows up in a ball. I drag it to the object in perspective, click on that cube thing to make it show. It shows. Now I export as GR2.

In my folders I have the GR2 model. I rename the targa to include (0,1,8,5) and convert to DDT. I place both in the same folder that I link to in the unit's XML.

When I open the game, the object is there and oriented properly but it's black.
posted 04-15-11 07:39 PM EDT (US)     23 / 28  
Well, somehow the models needs to know which texture parts it should "wear". There are surely different ways to do that, but I didn't do that cause I haven't needed it yet. The models I use had textures applied already.

The Ancient Age | Napoleonic Era

Modding is art!
posted 05-01-11 03:17 PM EDT (US)     24 / 28  
Anyone figure out how to get textures working?
I noticed that textures do not appear in BRF when I import my static mesh. It's a violet checkered pattern whereas the image above in the tutorial in BRF has a texture. BRF allows you to import a texture that is in DDS format. How do I convert my textures to DDS?
posted 05-02-11 06:53 AM EDT (US)     25 / 28  
Have you added a UVW Map in 3DS Max?


peugeot407

|> Robert Faber (aka peugeot407)
|> Humble Creator of: Knights and Barbarians, Danish Civ Mod, Several Tutorials and the Tutorial Database
|> November 2007 Modding Contest: 2nd place (me: 360 pts, Captain_Soanso: 365 pts!)
|> January 2008 Modding Contest: first place!

When in doubt, flat out! (Colin McRae)
posted 05-09-11 04:09 PM EDT (US)     26 / 28  
Peugeot, I explained my process just a couple of posts up. I think that I have added UVW map as the textures show up in 3ds max but not in game.

Have you tried working from 3ds max and BRF only?
posted 06-16-11 01:19 AM EDT (US)     27 / 28  
i am tired of see those post about granny models, stupid things and "it is impossible" .... I BEAT the WHOLE granny file, I get the first imported model, i do my own model and exported into the game without any help and FINALLY i know how manage the direction, the rotation, scale, etc in granny files.... so, after research those things in 3DMAX and a hard work of three days, i finally get with a animation that WORKS!! ... but.... there is a little problem with that.... the animation doesnt work as i want, but i still looking how fixed it :P so, stay calm, i dont promise anything yet.....

|THE MAIN CODDER AND ARTIST OF TFN
|check own progress here: http://thefightofnations.heavenforum.com/forum.htm
posted 06-16-11 02:42 AM EDT (US)     28 / 28  
Any news on getting models straight from 3ds max 7 to AOE with textures intact?
Age of Empires III Heaven » Forums » Modding Discussions » Tutorial : How to add a new model?
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Empires III Heaven | HeavenGames